5 changed files with 103 additions and 0 deletions
			
			
		@ -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; | 
				
			||||
} | 
				
			||||
@ -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))); | 
				
			||||
    } | 
				
			||||
} | 
				
			||||
@ -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> { | 
				
			||||
 | 
				
			||||
} | 
				
			||||
@ -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> { | 
				
			||||
 | 
				
			||||
} | 
				
			||||
@ -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…
					
					
				
		Reference in new issue