Commit 2a438e49 authored by Quxl's avatar Quxl

xxx

parent 005ebd37
......@@ -147,15 +147,15 @@ public class AdminAuthController {
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="int", required=true, name="group_id", value="组ID"),
})
public Object groupAuth(Integer group_id) throws FileNotFoundException {
public Object groupAuthQuery(Integer group_id) throws FileNotFoundException {
List<Map<String, Object>> list = service.queryGroupAuth(group_id);
return Rjx.jsonOk().setData(list);
}
@ResponseBody
@PostMapping("updateGroupAuth")
@PostMapping("groupAuthUpdate")
@ApiOperation("保存或更新管理组权限")
public Object updateGroupAuth(Integer group_id, Integer[] menu_id, Integer[] film_type) {
public Object groupAuthUpdate(Integer group_id, Integer[] menu_id, Integer[] film_type) {
service.updateGroupAuth(group_id, menu_id, film_type);
return Rjx.jsonOk();
}
......@@ -168,7 +168,14 @@ public class AdminAuthController {
group.setGroup_id(group_id);
group.setGroup_name(group_name);
group.setState(state);
service.saveOrUpdateGroup(group);
if(group.getGroup_id() == null) {
group.setAdminid((Integer)tokenService.getToken().getId());
String remoteIp = WebMvcConfig.getRemoteIp();
group.setUser_num(0L);
group.setCreate_ip(remoteIp);
group.setCreate_time(System.currentTimeMillis());
}
service.mergeGroup(group);
return Rjx.jsonOk();
}
......
......@@ -9,7 +9,7 @@ import com.egolm.film.bean.Fc_admin_group;
public interface AdminAuthService {
void saveOrUpdateGroup(Fc_admin_group group);
void mergeGroup(Fc_admin_group group);
List<Map<String, Object>> queryGroupList(String keyword, Page page);
......
......@@ -16,7 +16,6 @@ import com.egolm.film.bean.Fc_admin;
import com.egolm.film.bean.Fc_admin_group;
import com.egolm.film.bean.Fc_admin_group_filmtype;
import com.egolm.film.bean.Fc_admin_group_menu;
import com.egolm.film.config.WebMvcConfig;
import com.egolm.film.util.SqlWhere;
@Service
......@@ -26,13 +25,7 @@ public class AdminAuthServiceImpl implements AdminAuthService {
JdbcTemplate jdbcTemplate;
@Override
public void saveOrUpdateGroup(Fc_admin_group group) {
if(group.getGroup_id() == null) {
String remoteIp = WebMvcConfig.getRemoteIp();
group.setUser_num(0L);
group.setCreate_ip(remoteIp);
group.setCreate_time(System.currentTimeMillis());
}
public void mergeGroup(Fc_admin_group group) {
jdbcTemplate.merge(group);
}
......
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