18 changed files with 331 additions and 80 deletions
@ -1,5 +1,10 @@ |
|||
package com.epmet.commons.thirdplat.bean; |
|||
|
|||
public class ThirdPlatUserInfo { |
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class ThirdPlatUserInfo { |
|||
private String openId; |
|||
private String name; |
|||
private String mobile; |
|||
} |
|||
|
@ -0,0 +1,20 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
@Data |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
public class ApiServiceFormDTO { |
|||
|
|||
public interface GetByCustomerId extends PageFormDTO.AddUserShowGroup {} |
|||
|
|||
@NotBlank(message = "客户ID不能为空", groups = { GetByCustomerId.class }) |
|||
private String customerId; |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class ThirdplatApiserviceResultDTO { |
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* aipService名称 |
|||
*/ |
|||
private String apiServiceName; |
|||
} |
@ -0,0 +1,36 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.result.ThirdplatApiserviceResultDTO; |
|||
import com.epmet.entity.CustomerThirdplatApiserviceEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* 客户所属的第三方平台的apiService列表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-01-20 |
|||
*/ |
|||
@Mapper |
|||
public interface CustomerThirdplatApiserviceDao extends BaseDao<CustomerThirdplatApiserviceEntity> { |
|||
|
|||
ThirdplatApiserviceResultDTO getByCustomerId(@Param("customerId") String customerId); |
|||
} |
@ -0,0 +1,51 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 客户所属的第三方平台的apiService列表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-01-20 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("customer_thirdplat_apiservice") |
|||
public class CustomerThirdplatApiserviceEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* aipService名称 |
|||
*/ |
|||
private String apiServiceName; |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.dto.result.ThirdplatApiserviceResultDTO; |
|||
import com.epmet.entity.CustomerThirdplatApiserviceEntity; |
|||
|
|||
public interface CustomerThirdplatApiServiceService { |
|||
|
|||
/** |
|||
* @Description 根据客户id查询客户第三方平台的ApiService |
|||
* @return |
|||
* @author wxz |
|||
* @date 2021.01.20 15:47 |
|||
*/ |
|||
ThirdplatApiserviceResultDTO getByCustomerId(String customerId); |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.epmet.dao.CustomerThirdplatApiserviceDao; |
|||
import com.epmet.dto.result.ThirdplatApiserviceResultDTO; |
|||
import com.epmet.entity.CustomerThirdplatApiserviceEntity; |
|||
import com.epmet.service.CustomerThirdplatApiServiceService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Service |
|||
public class CustomerThirdplatApiServiceServiceImpl implements CustomerThirdplatApiServiceService { |
|||
|
|||
@Autowired |
|||
private CustomerThirdplatApiserviceDao thirdplatApiserviceDao; |
|||
|
|||
@Override |
|||
public ThirdplatApiserviceResultDTO getByCustomerId(String customerId) { |
|||
return thirdplatApiserviceDao.getByCustomerId(customerId); |
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
create table customer_thirdplat_apiservice |
|||
( |
|||
`ID` varchar(64) NOT NULL COMMENT '唯一标识', |
|||
`CUSTOMER_ID` varchar(64) not null comment '客户id', |
|||
`API_SERVICE_NAME` varchar(64) not null comment 'aipService名称', |
|||
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', |
|||
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间' |
|||
) ENGINE = InnoDB |
|||
DEFAULT CHARSET = utf8mb4 |
|||
collate utf8mb4_general_ci COMMENT ='客户所属的第三方平台的apiService列表'; |
@ -0,0 +1,33 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.CustomerThirdplatApiserviceDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.CustomerThirdplatApiserviceEntity" id="customerThirdplatApiserviceMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="apiServiceName" column="API_SERVICE_NAME"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<select id="getByCustomerId" resultType="com.epmet.dto.result.ThirdplatApiserviceResultDTO"> |
|||
select id, |
|||
customer_id, |
|||
api_service_name, |
|||
del_flag, |
|||
revision, |
|||
created_by, |
|||
created_time, |
|||
updated_by, |
|||
updated_time |
|||
from customer_thirdplat_apiservice cta |
|||
where cta.CUSTOMER_ID = #{customerId} |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue