Commit 5ec25f97 by zhiwj

小程序资源组权限

parent 7cd15f8d
package com.gic.enterprise.qo;
import java.util.List;
/**
*
* @Description:
......@@ -18,6 +20,7 @@ public class AppletServiceConfigQO extends PageQO {
private Integer type;
private Integer pageNum;
private String orderBy;
private List<Long> appIdList;
public Integer getSortColumn() {
return sortColumn;
......@@ -74,4 +77,12 @@ public class AppletServiceConfigQO extends PageQO {
public String getOrderBy() {
return orderBy;
}
public List<Long> getAppIdList() {
return appIdList;
}
public void setConfigIdList(List<Long> appIdList) {
this.appIdList = appIdList;
}
}
......@@ -34,6 +34,11 @@ public class TabAppletServiceConfig {
/**
*
*/
private Long configId;
/**
*
*/
private Date createTime;
/**
......@@ -86,6 +91,14 @@ public class TabAppletServiceConfig {
this.type = type;
}
public Long getConfigId() {
return configId;
}
public void setConfigId(Long configId) {
this.configId = configId;
}
public Date getCreateTime() {
return createTime;
}
......
......@@ -7,12 +7,14 @@
<result column="app_id" jdbcType="VARCHAR" property="appId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="config_id" jdbcType="BIGINT" property="configId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<sql id="Base_Column_List">
applet_service_id, enterprise_id, app_id, name, type, create_time, update_time, status
applet_service_id, enterprise_id, app_id, name, type, config_id, create_time, update_time,
status
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -26,11 +28,13 @@
</delete>
<insert id="insert" parameterType="com.gic.enterprise.entity.TabAppletServiceConfig">
insert into tab_applet_service_config (applet_service_id, enterprise_id, app_id,
name, type, create_time,
update_time, status)
name, type, config_id,
create_time, update_time, status
)
values (#{appletServiceId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{appId,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER})
#{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{configId,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabAppletServiceConfig">
insert into tab_applet_service_config
......@@ -50,6 +54,9 @@
<if test="type != null">
type,
</if>
<if test="configId != null">
config_id,
</if>
<if test="createTime != null">
create_time,
</if>
......@@ -76,6 +83,9 @@
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="configId != null">
#{configId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -102,6 +112,9 @@
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
<if test="configId != null">
config_id = #{configId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -120,6 +133,7 @@
app_id = #{appId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=INTEGER},
config_id = #{configId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
......@@ -156,6 +170,12 @@
<if test="search != null and search != '' ">
and name like concat('%', #{search}, '%')
</if>
<if test="null != ids and ids.size &gt; 0">
and config_id in
<foreach close=")" collection="ids" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="getAppByAppId" resultMap="BaseResultMap">
select
......
......@@ -2,6 +2,8 @@ package com.gic.enterprise.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.dto.ChannelResourceDTO;
import com.gic.auth.service.ResourceApiService;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.download.utils.log.LogUtils;
import com.gic.enterprise.constant.applet.AppletServiceConfigEnum;
......@@ -10,6 +12,7 @@ import com.gic.enterprise.qo.AppletServiceConfigQO;
import com.gic.enterprise.service.AppletServiceConfigApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -25,15 +28,27 @@ public class AppletServiceConfigController {
@Autowired
private AppletServiceConfigApiService appletServiceConfigApiService;
@Autowired
private ResourceApiService resourceApiService;
@RequestMapping("list-applet")
public RestResponse listApplet(AppletServiceConfigQO appletServiceConfigQO) {
ChannelResourceDTO channelResourceDTO = resourceApiService.getChannelResourceByUserId(UserDetailUtils.getUserDetail().getUserId()).getResult();
if (channelResourceDTO == null || CollectionUtils.isEmpty(channelResourceDTO.getAppletConfigIdList())) {
return RestResponse.success(new Page<>());
}
appletServiceConfigQO.setConfigIdList(channelResourceDTO.getAppletConfigIdList());
ServiceResponse<Page<AppletServiceConfigDTO>> serviceResponse = appletServiceConfigApiService.listApplet(UserDetailUtils.getUserDetail().getEnterpriseId(), appletServiceConfigQO);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("list-service")
public RestResponse listService(AppletServiceConfigQO appletServiceConfigQO) {
ChannelResourceDTO channelResourceDTO = resourceApiService.getChannelResourceByUserId(UserDetailUtils.getUserDetail().getUserId()).getResult();
if (channelResourceDTO == null || CollectionUtils.isEmpty(channelResourceDTO.getServiceConfigIdList())) {
return RestResponse.success(new Page<>());
}
appletServiceConfigQO.setConfigIdList(channelResourceDTO.getAppletConfigIdList());
ServiceResponse<Page<AppletServiceConfigDTO>> serviceResponse = appletServiceConfigApiService.listService(UserDetailUtils.getUserDetail().getEnterpriseId(), appletServiceConfigQO);
return ResultControllerUtils.commonResult(serviceResponse);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment