Commit 61eb0de2 authored by 廖旭伟's avatar 廖旭伟

增加自助终端应用下架接口

parent 8932f877
...@@ -39,4 +39,11 @@ public interface SstAppsService extends ICRUDService<SstAppsEntity,Long>{ ...@@ -39,4 +39,11 @@ public interface SstAppsService extends ICRUDService<SstAppsEntity,Long>{
* @return * @return
*/ */
Map<String, Object> getAppListBySite(Long siteId); Map<String, Object> getAppListBySite(Long siteId);
/**
* 应用下架
* @param appId
* @param userId
*/
void forbidden(Long appId,Long userId);
} }
\ No newline at end of file
...@@ -172,4 +172,16 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA ...@@ -172,4 +172,16 @@ public class SstAppsServiceImpl extends AbstractCRUDServiceImpl<SstAppsDao, SstA
} }
return siteApp; return siteApp;
} }
@Override
public void forbidden(Long appId, Long userId) {
Map<String,Object> condition = new HashMap<>();
condition.put("appId",appId);
Map<String,Object> data = new HashMap<>();
data.put("showBasic",0);
data.put("showHot",0);
data.put("updateUserId",userId);
data.put("updateTime",new Date());
this.dao.update(data,condition);
}
} }
\ No newline at end of file
package com.mortals.xhx.module.sst.web; package com.mortals.xhx.module.sst.web;
import com.mortals.framework.annotation.RepeatSubmit;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.IUser;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -13,12 +17,10 @@ import com.mortals.xhx.module.sst.model.SstAppsEntity; ...@@ -13,12 +17,10 @@ import com.mortals.xhx.module.sst.model.SstAppsEntity;
import com.mortals.xhx.module.sst.service.SstAppsService; import com.mortals.xhx.module.sst.service.SstAppsService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
...@@ -47,5 +49,30 @@ public class SstAppsController extends BaseCRUDJsonBodyMappingController<SstApps ...@@ -47,5 +49,30 @@ public class SstAppsController extends BaseCRUDJsonBodyMappingController<SstApps
super.init(model, context); super.init(model, context);
} }
@PostMapping({"forbidden"})
public Rest<Object> forbidden(@RequestBody SstAppsEntity entity) {
IUser user = this.getCurUser();
if(user==null){
throw new AppException("用户未登录");
}
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
String busiDesc = "自助终端应用下架" ;
int code=1;
try {
this.service.forbidden(entity.getAppId(),user.getId());
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
} }
\ No newline at end of file
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