Browse Source

#大模型白名单

zhongwei
yang_shj 5 months ago
parent
commit
c58404a342
  1. 24
      hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/entity/WhitelistEntity.java
  2. 38
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/controller/WhitelistController.java
  3. 11
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/mapper/WhitelistMapper.java
  4. 12
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/service/WhitelistService.java
  5. 18
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/service/impl/WhitelistServiceImpl.java

24
hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/entity/WhitelistEntity.java

@ -0,0 +1,24 @@
package com.hnac.hzims.bigmodel.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
/**
* @author ysj
*/
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_whitelist")
@ApiModel(value = "白名单实体类",description = "大模型白名单")
@Data
public class WhitelistEntity extends TenantEntity {
@ApiModelProperty(value = "用户Id")
private Long userId;
@ApiModelProperty(value = "用户登录账号")
private String account;
}

38
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/controller/WhitelistController.java

@ -0,0 +1,38 @@
package com.hnac.hzims.bigmodel.whitelist.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.bigmodel.BigModelConstants;
import com.hnac.hzims.bigmodel.entity.WhitelistEntity;
import com.hnac.hzims.bigmodel.whitelist.service.WhitelistService;
import com.hnac.hzinfo.log.annotation.Business;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.api.R;
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;
import java.util.List;
/**
* @author ysj
*/
@RestController
@RequestMapping("/whitelist")
@Api(value = "白名单用户",tags = "白名单用户")
@Business(module = BigModelConstants.MODULE_NAME,value = "大模型函数管理")
@AllArgsConstructor
public class WhitelistController {
private final WhitelistService whitelistService;
@PostMapping("/list")
@ApiOperation("查询列表")
@ApiOperationSupport(order = 1)
public R<List<WhitelistEntity>> list(@RequestBody WhitelistEntity entity) {
return R.data(whitelistService.list(Condition.getQueryWrapper(entity)));
}
}

11
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/mapper/WhitelistMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.bigmodel.whitelist.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.bigmodel.entity.WhitelistEntity;
/**
* @author ysj
*/
public interface WhitelistMapper extends BaseMapper<WhitelistEntity> {
}

12
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/service/WhitelistService.java

@ -0,0 +1,12 @@
package com.hnac.hzims.bigmodel.whitelist.service;
import com.hnac.hzims.bigmodel.entity.WhitelistEntity;
import org.springblade.core.mp.base.BaseService;
/**
* @author ysj
*/
public interface WhitelistService extends BaseService<WhitelistEntity> {
}

18
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/service/impl/WhitelistServiceImpl.java

@ -0,0 +1,18 @@
package com.hnac.hzims.bigmodel.whitelist.service.impl;
import com.hnac.hzims.bigmodel.entity.WhitelistEntity;
import com.hnac.hzims.bigmodel.whitelist.mapper.WhitelistMapper;
import com.hnac.hzims.bigmodel.whitelist.service.WhitelistService;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* @Author: huangxing
* @Date: 2024/04/26 11:13
*/
@Service
@Slf4j
public class WhitelistServiceImpl extends BaseServiceImpl<WhitelistMapper, WhitelistEntity> implements WhitelistService {
}
Loading…
Cancel
Save