You've already forked FrameTour-BE
87 lines
2.3 KiB
Java
87 lines
2.3 KiB
Java
package com.ycwl.basic.controller.mobile;
|
||
|
||
import com.ycwl.basic.annotation.IgnoreToken;
|
||
import com.ycwl.basic.model.mobile.DTO.WeChatUserInfoDTO;
|
||
import com.ycwl.basic.model.mobile.DTO.WeChatUserInfoUpdateDTO;
|
||
import com.ycwl.basic.model.pc.member.resp.MemberRespVO;
|
||
import com.ycwl.basic.service.mobile.AppMemberService;
|
||
import com.ycwl.basic.utils.ApiResponse;
|
||
import io.swagger.annotations.Api;
|
||
import io.swagger.annotations.ApiOperation;
|
||
import lombok.extern.slf4j.Slf4j;
|
||
import org.springframework.beans.factory.annotation.Autowired;
|
||
import org.springframework.web.bind.annotation.*;
|
||
|
||
/**
|
||
* @Author:longbinbin
|
||
* @Date:2024/12/4 16:54
|
||
*/
|
||
@RestController
|
||
@RequestMapping("/api/mobile/member/v1")
|
||
@Api(tags = "用户相关接口")
|
||
@Slf4j
|
||
public class AppMemberController {
|
||
|
||
@Autowired
|
||
private AppMemberService memberService;
|
||
|
||
/**
|
||
* 登录
|
||
*
|
||
* @param code
|
||
* @param userInfoDTO
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
@ApiOperation("登录")
|
||
@PostMapping("/login")
|
||
@IgnoreToken
|
||
public ApiResponse<?> login(@RequestParam(value = "code") String code,
|
||
@RequestParam(value = "userInfoDTO") WeChatUserInfoDTO userInfoDTO) throws Exception {
|
||
return memberService.login(code, userInfoDTO);
|
||
}
|
||
|
||
/**
|
||
* 获取用户信息
|
||
*
|
||
* @return
|
||
*/
|
||
@ApiOperation("获取用户信息")
|
||
@GetMapping("/getUserInfo")
|
||
public ApiResponse<MemberRespVO> getUserInfo() {
|
||
return memberService.getUserInfo();
|
||
}
|
||
|
||
/**
|
||
* 修改用户信息
|
||
*
|
||
* @param userInfoUpdateDTO
|
||
* @return
|
||
*/
|
||
@ApiOperation("修改用户信息")
|
||
@PostMapping("/update")
|
||
public ApiResponse<?> update(@RequestBody WeChatUserInfoUpdateDTO userInfoUpdateDTO) {
|
||
return memberService.update(userInfoUpdateDTO);
|
||
}
|
||
|
||
/**
|
||
* 同意用户协议
|
||
*
|
||
* @return
|
||
*/
|
||
@ApiOperation("同意用户协议")
|
||
@GetMapping("/agreement")
|
||
public ApiResponse<?> agreement() {
|
||
return memberService.agreement();
|
||
}
|
||
|
||
|
||
@ApiOperation("是否首次获取视频")
|
||
@GetMapping("/isFirstObtainVideo")
|
||
public ApiResponse isFirstTimeObtainingVideo() {
|
||
// TODO 判断是否首次获取视频逻辑
|
||
|
||
return ApiResponse.success("");
|
||
}
|
||
}
|