|
|
|
package com.epmet.controller;
|
|
|
|
|
|
|
|
import com.epmet.commons.tools.utils.Result;
|
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils;
|
|
|
|
import com.epmet.dto.form.LoginFormDTO;
|
|
|
|
import com.epmet.dto.form.ThirdWxmpEnteOrgFormDTO;
|
|
|
|
import com.epmet.dto.result.UserTokenResultDTO;
|
|
|
|
import com.epmet.service.ThirdLoginService;
|
|
|
|
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 sun
|
|
|
|
*/
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("thirdlogin")
|
|
|
|
public class ThirdLoginController {
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private ThirdLoginService thirdLoginService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param formDTO
|
|
|
|
* @return
|
|
|
|
* @Author sun
|
|
|
|
* @Description 单客户-居民端微信小程序登录
|
|
|
|
**/
|
|
|
|
@PostMapping("resilogin")
|
|
|
|
public Result<UserTokenResultDTO> resiLogin(@RequestBody LoginFormDTO formDTO) {
|
|
|
|
ValidatorUtils.validateEntity(formDTO);
|
|
|
|
return new Result<UserTokenResultDTO>().ok(thirdLoginService.resiLogin(formDTO));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param formDTO
|
|
|
|
* @return
|
|
|
|
* @Author sun
|
|
|
|
* @Description 单客户-政府端微信小程序登录
|
|
|
|
**/
|
|
|
|
@PostMapping("worklogin")
|
|
|
|
public Result<UserTokenResultDTO> workLogin(@RequestBody LoginFormDTO formDTO) {
|
|
|
|
ValidatorUtils.validateEntity(formDTO);
|
|
|
|
return new Result<UserTokenResultDTO>().ok(thirdLoginService.workLogin(formDTO));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param formDTO
|
|
|
|
* @return
|
|
|
|
* @Author sun
|
|
|
|
* @Description 单客户-选择组织,进入首页
|
|
|
|
**/
|
|
|
|
@PostMapping(value = "enterorg")
|
|
|
|
public Result<UserTokenResultDTO> enterOrg(@RequestBody ThirdWxmpEnteOrgFormDTO formDTO) {
|
|
|
|
ValidatorUtils.validateEntity(formDTO,ThirdWxmpEnteOrgFormDTO.AddUserShowGroup.class,ThirdWxmpEnteOrgFormDTO.AddUserInternalGroup.class);
|
|
|
|
UserTokenResultDTO userTokenResultDTO=thirdLoginService.enterOrg(formDTO);
|
|
|
|
return new Result<UserTokenResultDTO>().ok(userTokenResultDTO);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|