当前位置: 首页 > news >正文

专门做旅游的视频网站南安梅山建设银行网站

专门做旅游的视频网站,南安梅山建设银行网站,淘宝客如何建立自己的网站,深圳东莞网站建设目录 1:交友项目【通用设置】 1.1:查询通用设置 1.1.1:接口地址 1.1.2:流程分析 1.1.3:代码实现 1.2:设置陌生人问题 1.2.1:接口地址 1.2.2:流程分析 1.2.3:代码…

目录

1:交友项目【通用设置】

1.1:查询通用设置

1.1.1:接口地址

1.1.2:流程分析

1.1.3:代码实现

1.2:设置陌生人问题

1.2.1:接口地址

1.2.2:流程分析

1.2.3:代码实现

1.3:通知设置

1.3.1:接口地址

1.3.2:流程分析

1.3.3:代码实现


1:交友项目【通用设置】

1.1:查询通用设置

 

 

 

1.1.1:接口地址

接口地址:http://192.168.136.160:3000/project/19/interface/api/268

 

1.1.2:流程分析

根据定义的文档接口,请求头需要接收,token信息,响应ResponseEntity<SettingVo>,创建SettingVo进行封装数据,

根据需求需要查询tb_question和tb_settings表中的信息,进行汇总到Vo中。

1.1.3:代码实现

 与前端交互的app-server模块

controller层实现

/*** @Author 爱吃豆的土豆、* @Date 2023/4/4 11:29*/
@RequestMapping("/users")
@RestController
public class UserController {@Resourceprivate UserService userService;@GetMapping("/settings")public ResponseEntity findUsersettings(){SettingsVo usersettings = userService.findUsersettings(UserHolder.getUserId());usersettings.setPhone(UserHolder.getMobile());return ResponseEntity.ok(usersettings);}
}

service层实现

   public SettingsVo findUsersettings(Long userId) {return userApi.findUsersettings(userId);}

统一封装接口的模块

SettingsVo findUsersettings(Long userId);

提供者模块(提供相关接口的实现)

@Overridepublic SettingsVo findUsersettings(Long userId) {Settings setting = setMapper.findSetting(userId);SettingsVo settingsVo = new SettingsVo();Long numberLong = new Long(userId);Integer id = numberLong.intValue();settingsVo.setId(id);if (setting.getGonggaoNotification() == 1){settingsVo.setGonggaoNotification(true);}else {settingsVo.setGonggaoNotification(false);}if (setting.getLikeNotification() == 1){settingsVo.setLikeNotification(true);}else {settingsVo.setLikeNotification(false);}if (setting.getPinglunNotification() == 1){settingsVo.setPinglunNotification(true);}else {settingsVo.setPinglunNotification(false);}Question question = questionMapper.findQuestion(userId);settingsVo.setStrangerQuestion(question.getTxt());return settingsVo;}

1.2:设置陌生人问题

1.2.1:接口地址

接口地址:http://192.168.136.160:3000/project/19/interf

 

1.2.3:代码实现

 与前端交互的app-server模块

 

controller层实现

    @PostMapping("/questions")public ResponseEntity editquestion(@RequestBody Map content){userService.editquestion(String.valueOf(content.get("content")), UserHolder.getUserId());return ResponseEntity.ok(null);}

service层实现

    public void editquestion(String content, Long id) {userApi.editquestion(content,id);}

统一封装接口的模块

 

  void editquestion(String content, Long id);

提供者模块(提供相关接口的实现)

    @Overridepublic void editquestion(String content, Long id) {//查询对应的数据Question question = questionMapper.findQuestion(id);//重新设置question.setTxt(content);questionMapper.updateById(question);}

1.3:通知设置

1.3.1:接口地址

通知管理:对通知进行保存或者更新的操作

http://192.168.136.160:3000/project/19/interface/api/280

 

 

1.3.2:流程分析

 

1.3.3:代码实现

 与前端交互的app-server模块

controller层实现

    @PostMapping("/notifications/setting")public ResponseEntity editsetting(@RequestBody SettingsVo settingsVo){userService.editsetting(settingsVo,UserHolder.getUserId());return ResponseEntity.ok(null);}

service层实现

    public void editsetting(SettingsVo settingsVo, Long userId) {userApi.editsetting(settingsVo,userId);}

统一封装接口的模块

 void editsetting(SettingsVo settingsVo, Long userId);

提供者模块(提供相关接口的实现)

@Overridepublic void editsetting(SettingsVo settingsVo, Long userId) {Settings settings = setMapper.findSetting(userId);if (settingsVo.getGonggaoNotification()){settings.setGonggaoNotification(1);}else {settings.setGonggaoNotification(0);}if (settingsVo.getLikeNotification()){settings.setLikeNotification(1);}else {settings.setLikeNotification(0);}if (settingsVo.getPinglunNotification()){settings.setPinglunNotification(1);}else {settings.setPinglunNotification(0);}setMapper.updateById(settings);}

http://www.yayakq.cn/news/634339/

相关文章:

  • 云南建设工程网站代练网站建设视频
  • seo网站推广经理招聘网站备案技巧
  • 深圳网站设计 深圳信科seo规则
  • 黄陂建设网站北京网站建设华网天下科技
  • p2p平台网站开发海南百度推广代理商
  • 大学两学一做网站乐山做网站
  • 外国纪录片网站机场建设网络系统管理比赛
  • 胶南网站建设哪家好怎么做模板wordpress
  • 网站常用布局方法广西建设厅考试网站首页
  • 建浏览器网站制作想开一家相亲网站 怎么做
  • 怎么去建设微信网站wordpress 单本小说
  • dede 网站搬家网站推广优化哪家公司好
  • 黄村做网站的公司南京微网站建设
  • 买模板做的网站表单数据在哪里看软装公司网站建设
  • 做外汇查哪个网站北京到广州快递要几天
  • 网站图标素材图片html素材图片
  • 织梦珠宝网站模板手机微网站制作
  • 做棋牌网站赚钱吗河北黄骅市简介
  • 服务器做网站有什么好处策划方案怎么做
  • 网站建设的地方做网站的公司为什么人少了
  • 网站制作好如何上线百度竞价开户渠道
  • 网博士智能建站wordpress简化
  • 网站建设 页面网站响应时间长
  • 房产网站关键词优化建设有访问量的网站
  • 企业网站开发流程公司logo设计logo
  • 美食网站建设的重要性简述一下网站的设计流程
  • 百捷网站建设工资logopond设计网站
  • 网站建设制作浩森宇特建筑人才网 中级职称评审费用
  • 怎么查看域名网站的容量到期网站的管理跟新维护有哪些
  • 会宁县建设局网站吉林哪里做网站