TASK:谷歌登录

This commit is contained in:
shahaibo
2024-11-13 15:44:48 +08:00
parent fadb5faf0d
commit fd10d4dbc4
9 changed files with 305 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ package com.ai.da.controller;
import com.ai.da.common.config.exception.BusinessException;
import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.common.response.Response;
import com.ai.da.mapper.primary.entity.Account;
import com.ai.da.mapper.primary.entity.TrialOrder;
import com.ai.da.model.dto.*;
import com.ai.da.model.vo.AccountLoginVO;
@@ -261,5 +262,39 @@ public class AccountController {
return Response.success(true);
}
@PostMapping("enterpriseLogin")
@ApiOperation(value = "企业登录")
public Response<AccountLoginVO> enterpriseLogin(@Valid @RequestBody AccountLoginDTO accountDTO) {
return Response.success(accountService.enterpriseLogin(accountDTO));
}
@PostMapping("schoolLogin")
@ApiOperation(value = "学校登录")
public Response<AccountLoginVO> schoolLogin(@Valid @RequestBody AccountLoginDTO accountDTO) {
return Response.success(accountService.schoolLogin(accountDTO));
}
@PostMapping("addOrUpdateSubAccount")
@ApiOperation(value = "子账号新增")
public Response<Boolean> addSubAccount(@Valid @RequestBody AddSubAccountDTO addSubAccountDTO) {
return Response.success(accountService.addSubAccount(addSubAccountDTO));
}
@PostMapping("deleteSubAccount")
@ApiOperation(value = "子账号删除")
public Response<Boolean> deleteSubAccount(@Valid @RequestBody AddSubAccountDTO addSubAccountDTO) {
return Response.success(accountService.deleteSubAccount(addSubAccountDTO));
}
@PostMapping("subAccountList")
@ApiOperation(value = "子账号查询")
public Response<PageBaseResponse<Account>> subAccountList(@Valid @RequestBody SubAccountPageDTO subAccountPageDTO) {
return Response.success(accountService.subAccountList(subAccountPageDTO));
}
@GetMapping("accountDetail")
@ApiOperation(value = "账号详情")
public Response<Account> accountDetail(@RequestParam("id") Long id) {
return Response.success(accountService.accountDetail(id));
}
}

View File

@@ -1,6 +1,7 @@
package com.ai.da.controller;
import com.ai.da.common.response.Response;
import com.ai.da.mapper.primary.entity.GoogleUser;
import com.ai.da.model.dto.*;
import com.ai.da.model.vo.AccountLoginVO;
import com.ai.da.service.AccountService;
@@ -121,4 +122,11 @@ public class ThirdPartyController {
public Response<String> googleCallback(@RequestParam("code") String code, HttpSession session) {
return Response.success(accountService.googleCallback(code, session));
}
@CrossOrigin
@GetMapping("/parseGoogleCredential")
public Response<GoogleUser> parseGoogleCredential(@RequestParam("credential") String credential) {
return Response.success(accountService.parseGoogleCredential(credential));
}
}