2025-02-20 15:33:11 +08:00
|
|
|
package com.ff.api.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.ff.annotation.CheckHeader;
|
|
|
|
|
import com.ff.api.response.TenantInfoResponse;
|
2025-02-22 10:58:23 +08:00
|
|
|
import com.ff.base.constant.Constants;
|
2025-02-20 15:33:11 +08:00
|
|
|
import com.ff.base.core.controller.BaseController;
|
|
|
|
|
import com.ff.base.core.domain.AjaxResult;
|
2025-02-21 14:39:21 +08:00
|
|
|
import com.ff.base.enums.QuotaType;
|
2025-02-22 10:58:23 +08:00
|
|
|
import com.ff.base.system.service.ISysDeptService;
|
|
|
|
|
import com.ff.base.system.service.ISysRoleService;
|
|
|
|
|
import com.ff.base.utils.SecurityUtils;
|
|
|
|
|
import com.ff.base.utils.StringUtils;
|
2025-02-20 15:33:11 +08:00
|
|
|
import com.ff.base.utils.bean.BeanUtils;
|
|
|
|
|
import com.ff.common.domain.TenantGameQuota;
|
|
|
|
|
import com.ff.common.domain.TenantSecretKey;
|
|
|
|
|
import com.ff.common.service.ITenantGameQuotaService;
|
2025-02-21 16:12:11 +08:00
|
|
|
import com.ff.common.service.ITenantSecretKeyService;
|
2025-02-20 15:33:11 +08:00
|
|
|
import com.ff.config.KeyConfig;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
2025-02-22 10:58:23 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2025-02-20 15:33:11 +08:00
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* api控制器
|
|
|
|
|
*
|
|
|
|
|
* @author shi
|
|
|
|
|
* @date 2025/02/10
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@CheckHeader
|
|
|
|
|
@RequestMapping("/api/agent")
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class ApiAgentController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
2025-02-21 16:12:11 +08:00
|
|
|
private ITenantSecretKeyService tenantSecretKeyService;
|
2025-02-22 10:58:23 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ISysRoleService roleService;
|
|
|
|
|
|
2025-02-20 15:33:11 +08:00
|
|
|
@Resource
|
2025-02-22 10:58:23 +08:00
|
|
|
private ISysDeptService deptService;
|
2025-02-20 15:33:11 +08:00
|
|
|
|
2025-02-22 10:58:23 +08:00
|
|
|
//
|
2025-02-21 16:12:11 +08:00
|
|
|
// /**
|
|
|
|
|
// * 信息
|
|
|
|
|
// *
|
|
|
|
|
// * @return {@link AjaxResult }
|
|
|
|
|
// */
|
|
|
|
|
// @PostMapping("/create/tenant")
|
2025-02-22 10:58:23 +08:00
|
|
|
// public AjaxResult createTenant(TenantSecretKey tenantSecretKey) {
|
|
|
|
|
// roleService.selectRoleList(tenantSecretKey)
|
|
|
|
|
// if (!userService.checkUserNameUnique(user))
|
|
|
|
|
// {
|
|
|
|
|
// return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
|
|
|
|
// }
|
|
|
|
|
// else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
|
|
|
|
// {
|
|
|
|
|
// return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
|
|
|
|
// }
|
|
|
|
|
// else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
|
|
|
|
// {
|
|
|
|
|
// return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
|
|
|
|
// }
|
|
|
|
|
// user.setCreateBy(getUsername());
|
|
|
|
|
// user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
|
|
|
|
// return toAjax(userService.insertUser(user));
|
|
|
|
|
//
|
2025-02-21 16:12:11 +08:00
|
|
|
// tenantSecretKey.setAgentId(getUserId());
|
|
|
|
|
// tenantSecretKeyService.insertTenantSecretKey(tenantSecretKey);
|
|
|
|
|
// return AjaxResult.success(tenantInfoResponse);
|
|
|
|
|
// }
|
2025-02-20 15:33:11 +08:00
|
|
|
|
|
|
|
|
}
|