You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.8 KiB
82 lines
2.8 KiB
5 years ago
|
package com.epmet.controller;
|
||
|
|
||
|
import com.epmet.commons.tools.utils.Result;
|
||
|
import com.epmet.commons.tools.validator.ValidatorUtils;
|
||
|
import com.epmet.dto.form.GovWxmpEnteOrgFormDTO;
|
||
|
import com.epmet.dto.form.GovWxmpFormDTO;
|
||
|
import com.epmet.dto.form.GovWxmpGetOrgsFormDTO;
|
||
|
import com.epmet.dto.form.SendSmsCodeFormDTO;
|
||
|
import com.epmet.dto.result.UserTokenResultDTO;
|
||
|
import com.epmet.service.GovLoginService;
|
||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
||
|
/**
|
||
|
* @Description 政府端登录
|
||
|
* @Author yinzuomei
|
||
|
* @Date 2020/4/20 10:54
|
||
|
*/
|
||
|
@RestController
|
||
|
@RequestMapping("gov")
|
||
|
public class GovLoginController {
|
||
|
@Autowired
|
||
|
private GovLoginService govLoginService;
|
||
|
|
||
|
/**
|
||
|
* @param formDTO
|
||
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.UserTokenResultDTO>
|
||
|
* @Author yinzuomei
|
||
|
* @Description 1、政府端小程序根据wxCode获取上一次登录信息,返回token
|
||
|
* @Date 2020/4/20 11:22
|
||
|
**/
|
||
|
@PostMapping(value = "/loginwxmp/loginbywxcode")
|
||
|
public Result<UserTokenResultDTO> loginByWxCode(GovWxmpFormDTO formDTO) {
|
||
|
ValidatorUtils.validateEntity(formDTO);
|
||
|
return govLoginService.loginByWxCode(formDTO);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param formDTO 手机号
|
||
|
* @return com.epmet.commons.tools.utils.Result
|
||
|
* @Author yinzuomei
|
||
|
* @Description 2、政府端微信小程序登录-发送验证码
|
||
|
* @Date 2020/4/18 10:58
|
||
|
**/
|
||
|
@PostMapping(value = "/loginwxmp/sendsmscode")
|
||
|
public Result sendSmsCode(@RequestBody SendSmsCodeFormDTO formDTO) {
|
||
|
ValidatorUtils.validateEntity(formDTO);
|
||
|
return govLoginService.sendSmsCode(formDTO);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param formDTO
|
||
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.common.token.dto.result.UserTokenResultDTO>
|
||
|
* @Author yinzuomei
|
||
|
* @Description 3、手机验证码获取组织
|
||
|
* @Date 2020/4/18 21:14
|
||
|
**/
|
||
|
@PostMapping(value = "/loginwxmp/getorgs")
|
||
|
public Result getorgs(GovWxmpGetOrgsFormDTO formDTO) {
|
||
|
ValidatorUtils.validateEntity(formDTO);
|
||
|
return govLoginService.getorgs(formDTO);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param formDTO
|
||
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.UserTokenResultDTO>
|
||
|
* @Author yinzuomei
|
||
|
* @Description 4、选择组织,进入首页
|
||
|
* @Date 2020/4/20 13:07
|
||
|
**/
|
||
|
@PostMapping(value = "/loginwxmp/enterorg")
|
||
|
public Result<UserTokenResultDTO> enterOrg(GovWxmpEnteOrgFormDTO formDTO) {
|
||
|
ValidatorUtils.validateEntity(formDTO);
|
||
|
return govLoginService.enterOrg(formDTO);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|