Commit a441f0ef authored by Quxl's avatar Quxl

管理组和权限

parent 2f135272
...@@ -164,19 +164,16 @@ public class AdminAuthController { ...@@ -164,19 +164,16 @@ public class AdminAuthController {
@ResponseBody @ResponseBody
@RequestMapping("groupSaveOrUpdate") @RequestMapping("groupSaveOrUpdate")
@ApiOperation("添加组") @ApiOperation("保存或更新组")
public Object groupSaveOrUpdate(Integer group_id, String group_name, Integer state, String film_type_name, String group_power) { public Object groupSaveOrUpdate(Integer group_id, String group_name, Integer state, String[] pwoer, String group_power) {
String remoteIp = WebMvcConfig.getRemoteIp();
Fc_admin_group group = new Fc_admin_group(); Fc_admin_group group = new Fc_admin_group();
group.setGroup_id(group_id); group.setGroup_id(group_id);
group.setGroup_name(group_name); group.setGroup_name(group_name);
group.setState(state); group.setState(state);
group.setCreate_ip(remoteIp);
group.setCreate_time(System.currentTimeMillis());
group.setGroup_power(group_power); group.setGroup_power(group_power);
group.setPower(pwoer == null ? "[]" : JSON.toJSONString(pwoer));
service.saveOrUpdateGroup(group); service.saveOrUpdateGroup(group);
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
} }
...@@ -12,6 +12,7 @@ import com.egolm.common.jdbc.Page; ...@@ -12,6 +12,7 @@ import com.egolm.common.jdbc.Page;
import com.egolm.film.api.admin.service.AdminAuthService; import com.egolm.film.api.admin.service.AdminAuthService;
import com.egolm.film.bean.Fc_admin; import com.egolm.film.bean.Fc_admin;
import com.egolm.film.bean.Fc_admin_group; import com.egolm.film.bean.Fc_admin_group;
import com.egolm.film.config.WebMvcConfig;
import com.egolm.film.util.SqlWhere; import com.egolm.film.util.SqlWhere;
@Service @Service
...@@ -23,7 +24,10 @@ public class AdminAuthServiceImpl implements AdminAuthService { ...@@ -23,7 +24,10 @@ public class AdminAuthServiceImpl implements AdminAuthService {
@Override @Override
public void saveOrUpdateGroup(Fc_admin_group group) { public void saveOrUpdateGroup(Fc_admin_group group) {
if(group.getGroup_id() == null) { if(group.getGroup_id() == null) {
group.setUser_num(0); String remoteIp = WebMvcConfig.getRemoteIp();
group.setUser_num(0L);
group.setCreate_ip(remoteIp);
group.setCreate_time(System.currentTimeMillis());
} }
jdbcTemplate.merge(group); jdbcTemplate.merge(group);
} }
......
...@@ -45,10 +45,15 @@ public class Fc_admin_group implements java.io.Serializable { ...@@ -45,10 +45,15 @@ public class Fc_admin_group implements java.io.Serializable {
*/ */
private Integer state; private Integer state;
/**
* 权限
*/
private String power;
/** /**
* 成员数量 * 成员数量
*/ */
private Integer user_num; private Long user_num;
/** /**
* 群组权限 * 群组权限
...@@ -71,16 +76,18 @@ public class Fc_admin_group implements java.io.Serializable { ...@@ -71,16 +76,18 @@ public class Fc_admin_group implements java.io.Serializable {
* @param create_ip 创建者ip * @param create_ip 创建者ip
* @param adminid 创建者uid * @param adminid 创建者uid
* @param state 小组状态 * @param state 小组状态
* @param power 权限
* @param user_num 成员数量 * @param user_num 成员数量
* @param group_power 群组权限 * @param group_power 群组权限
*/ */
public Fc_admin_group(Integer group_id, String group_name, Long create_time, String create_ip, Integer adminid, Integer state, Integer user_num, String group_power) { public Fc_admin_group(Integer group_id, String group_name, Long create_time, String create_ip, Integer adminid, Integer state, String power, Long user_num, String group_power) {
this.group_id = group_id; this.group_id = group_id;
this.group_name = group_name; this.group_name = group_name;
this.create_time = create_time; this.create_time = create_time;
this.create_ip = create_ip; this.create_ip = create_ip;
this.adminid = adminid; this.adminid = adminid;
this.state = state; this.state = state;
this.power = power;
this.user_num = user_num; this.user_num = user_num;
this.group_power = group_power; this.group_power = group_power;
} }
...@@ -133,11 +140,19 @@ public class Fc_admin_group implements java.io.Serializable { ...@@ -133,11 +140,19 @@ public class Fc_admin_group implements java.io.Serializable {
return state; return state;
} }
public void setUser_num(Integer user_num) { public void setPower(String power) {
this.power = power;
}
public String getPower() {
return power;
}
public void setUser_num(Long user_num) {
this.user_num = user_num; this.user_num = user_num;
} }
public Integer getUser_num() { public Long getUser_num() {
return user_num; return user_num;
} }
......
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