Selaa lähdekoodia

查询达人信息

zhaoxian 2 vuotta sitten
vanhempi
commit
4b667c817b

+ 2 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouPromoterController.java

@@ -62,8 +62,8 @@ public class KuaishouPromoterController extends BaseController {
      */
     @GetMapping(value = "/getPromoterInfo")
     @ApiOperation(value = "获取快手达人信息")
-    public AjaxResult getPromoterInfo(@ApiParam("主键") @RequestParam(value = "id", required = true) Long id) {
-        return kuaishouPromoterService.getPromoterInfo(id);
+    public AjaxResult getPromoterInfo(@ApiParam("达人ID") @RequestParam(value = "promoterId", required = true) Long promoterId) {
+        return kuaishouPromoterService.getPromoterInfo(promoterId);
     }
 
 

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouPromoterService.java

@@ -61,5 +61,5 @@ public interface IKuaishouPromoterService {
      */
     public int deleteKuaishouPromoterById(Long id);
 
-    AjaxResult getPromoterInfo(Long id);
+    AjaxResult getPromoterInfo(Long promoterId);
 }

+ 2 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java

@@ -209,10 +209,10 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
     }
 
     @Override
-    public AjaxResult getPromoterInfo(Long id) {
+    public AjaxResult getPromoterInfo(Long promoterId) {
         AjaxResult ajaxResult = null;
         try {
-            KuaishouPromoter promoter = kuaishouPromoterMapper.selectKuaishouPromoterById(id);
+            KuaishouPromoter promoter = kuaishouPromoterMapper.getOneByIdAndPromoterId(null,promoterId);
             JSONObject data = new JSONObject();
             if (Check.isNotNull(promoter)) {
                 Thread thread = new Thread() {

+ 4 - 2
ruixuan-live/src/main/resources/mapper/isc/KuaishouPromoterMapper.xml

@@ -70,8 +70,10 @@
 
     <select id="getOneByIdAndPromoterId" resultMap="KuaishouPromoterResult">
         <include refid="selectKuaishouPromoterVo"/>
-        where user_id = #{userId}
-        AND promoter_id = #{promoterId}
+        where promoter_id = #{promoterId}
+        <if test="userId != null ">
+            AND user_id = #{userId}
+        </if>
     </select>
 
     <insert id="insertKuaishouPromoter" parameterType="com.ruixuan.isc.entity.KuaishouPromoter" useGeneratedKeys="true"