Commit 0de55edf authored by Quxl's avatar Quxl

x

parent f8cd7d6e
...@@ -31,5 +31,9 @@ public interface AdminAuthService { ...@@ -31,5 +31,9 @@ public interface AdminAuthService {
void saveOrUpdateMenu(Fc_admin_menu menu); void saveOrUpdateMenu(Fc_admin_menu menu);
void enableAdmin(Integer[] adminid); void enableAdmin(Integer[] adminid);
Fc_admin queryAdminById(Integer id);
boolean changePasswordByMemberId(Integer id, String password, String newPassword);
} }
...@@ -17,6 +17,7 @@ import com.egolm.film.bean.Fc_admin_group; ...@@ -17,6 +17,7 @@ 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_filmtype;
import com.egolm.film.bean.Fc_admin_group_menu; import com.egolm.film.bean.Fc_admin_group_menu;
import com.egolm.film.bean.Fc_admin_menu; import com.egolm.film.bean.Fc_admin_menu;
import com.egolm.film.util.Common;
import com.egolm.film.util.SqlWhere; import com.egolm.film.util.SqlWhere;
@Service @Service
...@@ -136,4 +137,19 @@ public class AdminAuthServiceImpl implements AdminAuthService { ...@@ -136,4 +137,19 @@ public class AdminAuthServiceImpl implements AdminAuthService {
jdbcTemplate.saveOrUpdate(menu); jdbcTemplate.saveOrUpdate(menu);
} }
public Fc_admin queryAdminById(Integer id) {
return jdbcTemplate.queryForBean("select * from fc_admin where adminid = ?", Fc_admin.class, id);
}
@Override
public boolean changePasswordByMemberId(Integer id, String password, String newPassword) {
Fc_admin admin = this.queryAdminById(id);
String encodePassword = Common.encodePassword(password, admin.getSalt());
if(encodePassword.equals(admin.getPassword())) {
String encodeNewPassword = Common.encodePassword(newPassword, admin.getSalt());
return jdbcTemplate.executeUpdate("update fc_admin set password = ? where adminid = ?", encodeNewPassword, admin.getAdminid()) == 1;
}
return false;
}
} }
...@@ -21,6 +21,7 @@ import com.egolm.film.bean.Fc_admin_group; ...@@ -21,6 +21,7 @@ import com.egolm.film.bean.Fc_admin_group;
import com.egolm.film.bean.Fc_admin_menu; import com.egolm.film.bean.Fc_admin_menu;
import com.egolm.film.config.WebMvcConfig; import com.egolm.film.config.WebMvcConfig;
import com.egolm.film.config.XException; import com.egolm.film.config.XException;
import com.egolm.film.model.LoginToken;
import com.egolm.film.util.Common; import com.egolm.film.util.Common;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -114,6 +115,26 @@ public class AdminAuthController { ...@@ -114,6 +115,26 @@ public class AdminAuthController {
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
@ResponseBody
@PostMapping("changePassword")
@ApiOperation("修改密码")
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", dataType="string", name="i18n_language"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "password", value="当前密码"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "newPassword", value="新密码"),
})
public Object changePassword(String password, String newPassword) {
XException.assertNotBlank("密码不能未空", password, newPassword);
LoginToken loginToken = tokenService.getToken();
Integer id = (Integer)loginToken.getId();
boolean boo = service.changePasswordByMemberId(id, password, newPassword);
if(boo) {
return Rjx.jsonOk();
} else {
return Rjx.jsonErr().setMessage("密码错误");
}
}
@ResponseBody @ResponseBody
@PostMapping("adminDilabled") @PostMapping("adminDilabled")
@ApiOperation("禁用管理员") @ApiOperation("禁用管理员")
......
...@@ -15,14 +15,49 @@ public class Fc_review_user_result implements java.io.Serializable { ...@@ -15,14 +15,49 @@ public class Fc_review_user_result implements java.io.Serializable {
@Id @Id
private Integer id; private Integer id;
private Integer film_id;
private Integer user_id; private Integer user_id;
private Integer review_id; private Integer review_id;
private Integer review_round;
/**
* 2通过,3否决,4参赛,5参赛备选,6参展
*/
private Integer review_state; private Integer review_state;
/**
* 得分分数
*/
private Double review_score;
/**
* 影片评论
*/
private String review_text; private String review_text;
/**
* 影片概述
*/
private String review_text_summary;
/**
* 叙事/题材
*/
private String review_text_theme;
/**
* 风格/美学
*/
private String review_text_style;
/**
* 突出/优缺点
*/
private String review_text_keynote;
/** /**
* 无参数构造方法 * 无参数构造方法
...@@ -34,17 +69,31 @@ public class Fc_review_user_result implements java.io.Serializable { ...@@ -34,17 +69,31 @@ public class Fc_review_user_result implements java.io.Serializable {
/** /**
* 全参数构造方法 * 全参数构造方法
* @param id * @param id
* @param film_id
* @param user_id * @param user_id
* @param review_id * @param review_id
* @param review_state * @param review_round
* @param review_text * @param review_state 2通过,3否决,4参赛,5参赛备选,6参展
* @param review_score 得分分数
* @param review_text 影片评论
* @param review_text_summary 影片概述
* @param review_text_theme 叙事/题材
* @param review_text_style 风格/美学
* @param review_text_keynote 突出/优缺点
*/ */
public Fc_review_user_result(Integer id, Integer user_id, Integer review_id, Integer review_state, String review_text) { public Fc_review_user_result(Integer id, Integer film_id, Integer user_id, Integer review_id, Integer review_round, Integer review_state, Double review_score, String review_text, String review_text_summary, String review_text_theme, String review_text_style, String review_text_keynote) {
this.id = id; this.id = id;
this.film_id = film_id;
this.user_id = user_id; this.user_id = user_id;
this.review_id = review_id; this.review_id = review_id;
this.review_round = review_round;
this.review_state = review_state; this.review_state = review_state;
this.review_score = review_score;
this.review_text = review_text; this.review_text = review_text;
this.review_text_summary = review_text_summary;
this.review_text_theme = review_text_theme;
this.review_text_style = review_text_style;
this.review_text_keynote = review_text_keynote;
} }
public void setId(Integer id) { public void setId(Integer id) {
...@@ -55,6 +104,14 @@ public class Fc_review_user_result implements java.io.Serializable { ...@@ -55,6 +104,14 @@ public class Fc_review_user_result implements java.io.Serializable {
return id; return id;
} }
public void setFilm_id(Integer film_id) {
this.film_id = film_id;
}
public Integer getFilm_id() {
return film_id;
}
public void setUser_id(Integer user_id) { public void setUser_id(Integer user_id) {
this.user_id = user_id; this.user_id = user_id;
} }
...@@ -71,6 +128,14 @@ public class Fc_review_user_result implements java.io.Serializable { ...@@ -71,6 +128,14 @@ public class Fc_review_user_result implements java.io.Serializable {
return review_id; return review_id;
} }
public void setReview_round(Integer review_round) {
this.review_round = review_round;
}
public Integer getReview_round() {
return review_round;
}
public void setReview_state(Integer review_state) { public void setReview_state(Integer review_state) {
this.review_state = review_state; this.review_state = review_state;
} }
...@@ -79,6 +144,14 @@ public class Fc_review_user_result implements java.io.Serializable { ...@@ -79,6 +144,14 @@ public class Fc_review_user_result implements java.io.Serializable {
return review_state; return review_state;
} }
public void setReview_score(Double review_score) {
this.review_score = review_score;
}
public Double getReview_score() {
return review_score;
}
public void setReview_text(String review_text) { public void setReview_text(String review_text) {
this.review_text = review_text; this.review_text = review_text;
} }
...@@ -87,5 +160,37 @@ public class Fc_review_user_result implements java.io.Serializable { ...@@ -87,5 +160,37 @@ public class Fc_review_user_result implements java.io.Serializable {
return review_text; return review_text;
} }
public void setReview_text_summary(String review_text_summary) {
this.review_text_summary = review_text_summary;
}
public String getReview_text_summary() {
return review_text_summary;
}
public void setReview_text_theme(String review_text_theme) {
this.review_text_theme = review_text_theme;
}
public String getReview_text_theme() {
return review_text_theme;
}
public void setReview_text_style(String review_text_style) {
this.review_text_style = review_text_style;
}
public String getReview_text_style() {
return review_text_style;
}
public void setReview_text_keynote(String review_text_keynote) {
this.review_text_keynote = review_text_keynote;
}
public String getReview_text_keynote() {
return review_text_keynote;
}
} }
...@@ -15,6 +15,16 @@ public class Fc_review_user_result_doubtful implements java.io.Serializable { ...@@ -15,6 +15,16 @@ public class Fc_review_user_result_doubtful implements java.io.Serializable {
@Id @Id
private Integer id; private Integer id;
private Integer film_id;
private Integer review_round;
private Integer user_id;
private Integer result_id;
private String review_text;
/** /**
* 无参数构造方法 * 无参数构造方法
...@@ -26,9 +36,19 @@ public class Fc_review_user_result_doubtful implements java.io.Serializable { ...@@ -26,9 +36,19 @@ public class Fc_review_user_result_doubtful implements java.io.Serializable {
/** /**
* 全参数构造方法 * 全参数构造方法
* @param id * @param id
* @param film_id
* @param review_round
* @param user_id
* @param result_id
* @param review_text
*/ */
public Fc_review_user_result_doubtful(Integer id) { public Fc_review_user_result_doubtful(Integer id, Integer film_id, Integer review_round, Integer user_id, Integer result_id, String review_text) {
this.id = id; this.id = id;
this.film_id = film_id;
this.review_round = review_round;
this.user_id = user_id;
this.result_id = result_id;
this.review_text = review_text;
} }
public void setId(Integer id) { public void setId(Integer id) {
...@@ -39,5 +59,45 @@ public class Fc_review_user_result_doubtful implements java.io.Serializable { ...@@ -39,5 +59,45 @@ public class Fc_review_user_result_doubtful implements java.io.Serializable {
return id; return id;
} }
public void setFilm_id(Integer film_id) {
this.film_id = film_id;
}
public Integer getFilm_id() {
return film_id;
}
public void setReview_round(Integer review_round) {
this.review_round = review_round;
}
public Integer getReview_round() {
return review_round;
}
public void setUser_id(Integer user_id) {
this.user_id = user_id;
}
public Integer getUser_id() {
return user_id;
}
public void setResult_id(Integer result_id) {
this.result_id = result_id;
}
public Integer getResult_id() {
return result_id;
}
public void setReview_text(String review_text) {
this.review_text = review_text;
}
public String getReview_text() {
return review_text;
}
} }
package com.egolm.film.bean;
import javax.persistence.Entity;
import javax.persistence.Id;
/**
* @author 曲欣亮
*/
@Entity(name="fc_review_user_result_ext")
public class Fc_review_user_result_ext implements java.io.Serializable {
private static final long serialVersionUID = 1L;
@Id
private Integer id;
private Integer film_id;
private Integer review_round;
private Integer user_id;
private Integer result_id;
private Integer enroll_type_id;
private Double enroll_score;
private String review_text;
/**
* 无参数构造方法
*/
public Fc_review_user_result_ext () {
super();
}
/**
* 全参数构造方法
* @param id
* @param film_id
* @param review_round
* @param user_id
* @param result_id
* @param enroll_type_id
* @param enroll_score
* @param review_text
*/
public Fc_review_user_result_ext(Integer id, Integer film_id, Integer review_round, Integer user_id, Integer result_id, Integer enroll_type_id, Double enroll_score, String review_text) {
this.id = id;
this.film_id = film_id;
this.review_round = review_round;
this.user_id = user_id;
this.result_id = result_id;
this.enroll_type_id = enroll_type_id;
this.enroll_score = enroll_score;
this.review_text = review_text;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setFilm_id(Integer film_id) {
this.film_id = film_id;
}
public Integer getFilm_id() {
return film_id;
}
public void setReview_round(Integer review_round) {
this.review_round = review_round;
}
public Integer getReview_round() {
return review_round;
}
public void setUser_id(Integer user_id) {
this.user_id = user_id;
}
public Integer getUser_id() {
return user_id;
}
public void setResult_id(Integer result_id) {
this.result_id = result_id;
}
public Integer getResult_id() {
return result_id;
}
public void setEnroll_type_id(Integer enroll_type_id) {
this.enroll_type_id = enroll_type_id;
}
public Integer getEnroll_type_id() {
return enroll_type_id;
}
public void setEnroll_score(Double enroll_score) {
this.enroll_score = enroll_score;
}
public Double getEnroll_score() {
return enroll_score;
}
public void setReview_text(String review_text) {
this.review_text = review_text;
}
public String getReview_text() {
return review_text;
}
}
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