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

武汉网站制作与建设中山网站seo优化

武汉网站制作与建设,中山网站seo优化,廊坊网站建设推广,上海公关公司有哪些目录 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.sczhlp.com/news/40868/

相关文章:

  • 深圳政府门户网站建设评价优化的含义是什么
  • 怎么建设微信二维码发在网站上苏州搜索引擎优化
  • 做影视网站侵权吗seo的方式有哪些
  • 北京金山办公软件有限公司郑州seo优化外包
  • 网站设计策划书3000字惠州seo计费管理
  • 常见CMD命令
  • 桂林市区旅游攻略必去景点苏州优化网站公司
  • 大连模板网站制作费用推广公司有哪些
  • 帮别人做ppt挣钱的网站中国十大营销策划机构
  • 手机网站 css网站seo优化分析
  • templates翻译seopeixun com cn
  • 如何实现网站的纯静态化福建seo推广方案
  • 南通专业企业门户网站设计周口网络推广哪家好
  • 凡科的网站怎么做百度推广百度电话号码查询
  • 购物网站建设流程长春建站程序
  • 做营销网站建设价格郑州最好的建站公司
  • 建设部网站一级建造师seo网站有哪些
  • 为了 门户网站建设汕头网页搜索排名提升
  • Tekton 在 Kubernetes 集群中的完整安装步骤
  • Oracle Database 19c 卸载
  • Oracle Database 19c 安装
  • QOJ 板刷记录2
  • 微软雅黑做网站是否侵权自己建站的网站
  • 绍兴网站制作计划百度浏览器网址大全
  • 如何一键建淘宝客网站2024年3月新冠肺炎
  • 宝塔搭建wordpress博客天津seo选天津旗舰科技a
  • 你的开发服务器在说谎-热重载与热重启的关键区别
  • python合适做网站吗免费建站
  • 专业的集团网站开发费用多少钱精准营销理论
  • 手机网站怎么建设百度推广怎么优化排名