feat(AI资源广场): Skill资源相关功能开发
优化资源及资源领域分类逻辑: 1. 保持原资源逻辑,当用户查询资源/资源领域列表时若未传入Category参数则代表查询原资源/资源领域 2. 支持获取所有资源/资源领域,当用户传入Category参数值为ALL时,则查询所有资源/资源领域
This commit is contained in:
parent
3126082f61
commit
fcefe43872
|
|
@ -98,10 +98,7 @@ public class ZoneResource extends ZoneSort {
|
|||
@ApiModelProperty(value = "拓展数据(JSON格式)")
|
||||
private JSONObject extendData;
|
||||
|
||||
/**
|
||||
* 资源分类:SKILL/MODEL/DATASET(NULL表示原有专区资源)
|
||||
*/
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET")
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET,NULL代表原资源")
|
||||
private String resourceCategory;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -24,9 +24,7 @@ public class ZoneResourceDomain extends ZoneSort {
|
|||
*/
|
||||
@Excel(name = "资源领域简介")
|
||||
private String introduction;
|
||||
/**
|
||||
* 资源分类:SKILL/MODEL/DATASET(NULL表示原有专区资源领域)
|
||||
*/
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET")
|
||||
private String resourceCategory;
|
||||
|
||||
@ApiModelProperty(value = "领域分类:SKILL/MODEL/DATASET,NULL代表原资源领域")
|
||||
private String domainCategory;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public class ZoneResourceDataVo {
|
|||
@ApiModelProperty(value = "拓展数据(JSON格式)")
|
||||
private JSONObject extendData;
|
||||
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET")
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET,NULL代表原资源")
|
||||
private String resourceCategory;
|
||||
|
||||
@ApiModelProperty(value = "审核意见/驳回原因")
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class ZoneResourceDomainInputVo {
|
|||
@ApiModelProperty(value = "所属专区", required = true)
|
||||
@NotNull
|
||||
private Long zoneId;
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET")
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET,NULL代表原资源")
|
||||
private String resourceCategory;
|
||||
|
||||
public ZoneResourceDomain toZoneResourceDomain() {
|
||||
|
|
|
|||
|
|
@ -18,14 +18,14 @@ public class ZoneResourceDomainSearchVo {
|
|||
@ApiModelProperty(value = "所属专区", required = true)
|
||||
@NotNull
|
||||
private Long zoneId;
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET")
|
||||
private String resourceCategory;
|
||||
@ApiModelProperty(value = "领域分类:SKILL/MODEL/DATASET/ALL,ALL代表所有资源领域,不传代表原资源领域")
|
||||
private String domainCategory;
|
||||
|
||||
public ZoneResourceDomain toZoneResourceDomain() {
|
||||
ZoneResourceDomain zoneResourceDomain = new ZoneResourceDomain();
|
||||
zoneResourceDomain.setZoneId(zoneId);
|
||||
zoneResourceDomain.setName(name);
|
||||
zoneResourceDomain.setResourceCategory(resourceCategory);
|
||||
zoneResourceDomain.setDomainCategory(domainCategory);
|
||||
return zoneResourceDomain;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,10 +34,8 @@ public class ZoneResourceInputVo {
|
|||
@ApiModelProperty(value = "所属专区", required = true)
|
||||
@NotNull
|
||||
private Long zoneId;
|
||||
/**
|
||||
* 资源分类:SKILL/MODEL/DATASET(NULL表示原有专区资源)
|
||||
*/
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET", hidden = true)
|
||||
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET,NULL代表原资源", hidden = true)
|
||||
private String resourceCategory = null;
|
||||
|
||||
@ApiModelProperty(value = "拓展数据")
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@ public class ZoneResourceOpenSearchVo extends BaseEntity {
|
|||
@ApiModelProperty(value = "审核状态(0:待审核,1:审核通过 2:审核不通过 3:已下架 4:草稿)",hidden = true)
|
||||
private String auditStatus="1";
|
||||
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET/ALL,ALL代表所有资源领域,NULL或者不传代表原资源")
|
||||
private String resourceCategory;
|
||||
|
||||
public ZoneResource toZoneResource() {
|
||||
ZoneResource target = new ZoneResource();
|
||||
BeanUtils.copyProperties(this, target);
|
||||
|
|
|
|||
|
|
@ -21,10 +21,8 @@ public class ZoneResourceSearchVo extends ZoneResourceOpenSearchVo {
|
|||
|
||||
@ApiModelProperty(value = "审核状态(0:待审核,1:审核通过 2:审核不通过 3:已下架 4:草稿 all:所有)")
|
||||
private String auditStatus;
|
||||
/**
|
||||
* 资源分类:SKILL/MODEL/DATASET(NULL表示原有专区资源)
|
||||
*/
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET")
|
||||
|
||||
@ApiModelProperty(value = "资源分类:SKILL/MODEL/DATASET/ALL,ALL代表所有资源领域,NULL或者不传代表原资源")
|
||||
private String resourceCategory;
|
||||
|
||||
@ApiModelProperty(value = "是否只查询我的")
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<result property="updateTime" column="update_time"/>
|
||||
<result property="zoneId" column="zone_id"/>
|
||||
<result property="introduction" column="introduction"/>
|
||||
<result property="resourceCategory" column="resource_category"/>
|
||||
<result property="domainCategory" column="domain_category"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZoneResourceDomainVo">
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
update_time,
|
||||
introduction,
|
||||
zone_id,
|
||||
resource_category
|
||||
domain_category
|
||||
from zone_resource_domain
|
||||
</sql>
|
||||
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
zrd.update_time,
|
||||
zrd.introduction,
|
||||
zrd.zone_id,
|
||||
zrd.resource_category
|
||||
zrd.domain_category
|
||||
from zone_resource_domain zrd
|
||||
</sql>
|
||||
|
||||
|
|
@ -55,6 +55,14 @@
|
|||
<include refid="selectZoneResourceDomainAliasVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''">and zrd.name like concat('%', #{name}, '%')</if>
|
||||
<choose>
|
||||
<when test="domainCategory != null and domainCategory !=''">
|
||||
<if test="domainCategory != 'ALL' and domainCategory != 'all'">and zrd.domain_category = #{domainCategory}</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
and zrd.domain_category is null
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="sort != null ">and zrd.sort = #{sort}</if>
|
||||
<if test="deptId != null ">and zrd.dept_id = #{deptId}</if>
|
||||
<if test="zoneId != null ">and zrd.zone_id = #{zoneId}</if>
|
||||
|
|
@ -88,7 +96,7 @@
|
|||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="zoneId != null">zone_id,</if>
|
||||
<if test="introduction != null">introduction,</if>
|
||||
<if test="resourceCategory != null">resource_category,</if>
|
||||
<if test="domainCategory != null">domain_category,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
|
|
@ -101,7 +109,7 @@
|
|||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="zoneId != null">#{zoneId},</if>
|
||||
<if test="introduction != null">#{introduction},</if>
|
||||
<if test="resourceCategory != null">#{resourceCategory},</if>
|
||||
<if test="domainCategory != null">#{domainCategory},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -118,7 +126,7 @@
|
|||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="zoneId != null">zone_id = #{zoneId},</if>
|
||||
<if test="introduction != null">introduction = #{introduction},</if>
|
||||
<if test="resourceCategory != null">resource_category = #{resourceCategory},</if>
|
||||
<if test="domainCategory != null">domain_category = #{domainCategory},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -146,9 +146,14 @@
|
|||
<if test="deptId != null ">and zr.dept_id = #{deptId}</if>
|
||||
<if test="createBy != null and createBy != ''">and zr.create_by = #{createBy}</if>
|
||||
<if test="keywords != null and keywords != ''">and zr.keywords like concat('%', #{keywords}, '%')</if>
|
||||
<if test="resourceCategory != null and resourceCategory != ''">and zr.resource_category =
|
||||
#{resourceCategory}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="resourceCategory != null and resourceCategory !=''">
|
||||
<if test="resourceCategory != 'ALL' and resourceCategory != 'all'">and zr.resource_category = #{resourceCategory}</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
and zr.resource_category is null
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="auditStatus != null and auditStatus !=''">
|
||||
<if test="auditStatus != 'all'">and zr.audit_status = #{auditStatus}</if>
|
||||
|
|
@ -178,6 +183,14 @@
|
|||
<if test="searchTypeId != null ">
|
||||
and zr.id in (select resource_id from zone_resource_to_type where type_id=#{searchTypeId})
|
||||
</if>
|
||||
<choose>
|
||||
<when test="resourceCategory != null and resourceCategory !=''">
|
||||
<if test="resourceCategory != 'ALL' and resourceCategory != 'all'">and zr.resource_category = #{resourceCategory}</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
and zr.resource_category is null
|
||||
</otherwise>
|
||||
</choose>
|
||||
<choose>
|
||||
<when test="auditStatus != null and auditStatus !=''">
|
||||
and zr.audit_status = #{auditStatus}
|
||||
|
|
|
|||
Loading…
Reference in New Issue