| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AdminAcceptData;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.customerservice.CustomerServiceCommonQuestion;
|
| | | import com.yeshi.fanli.exception.CustomerServiceCommonQuestionException;
|
| | | import com.yeshi.fanli.exception.user.CustomerServiceCommonQuestionException;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.customerservice.CustomerServiceCommonQuestionService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.common.entity.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/commonQuestion")
|
| | |
| | | /**
|
| | | * 新增
|
| | | * @param callback
|
| | | * @param special
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "save")
|
| | | public void saveAdd(String callback, long uid, CustomerServiceCommonQuestion commonQuestion, |
| | | HttpServletResponse response, PrintWriter out) {
|
| | |
|
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | | public void saveAdd(AdminAcceptData acceptData, String callback, long uid, CustomerServiceCommonQuestion commonQuestion,
|
| | | PrintWriter out) {
|
| | |
|
| | | try {
|
| | | |
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | |
|
| | | commonQuestionService.save(commonQuestion);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("添加成功"));
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getInfo")
|
| | | public void getInfo(String callback, Long id, PrintWriter out) {
|
| | | public void getInfo(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
|
| | |
|
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveWeight")
|
| | | public void saveWeight(String callback, Long id, Integer weight, PrintWriter out) {
|
| | | public void saveWeight(AdminAcceptData acceptData,String callback, Long id, Integer weight, PrintWriter out) {
|
| | |
|
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "updateState")
|
| | | public void updateState(String callback, Long id, PrintWriter out) {
|
| | | public void updateState(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
|
| | | try {
|
| | |
|
| | | if (id == null) {
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key,
|
| | | public void query(AdminAcceptData acceptData,String callback, Integer pageIndex, Integer pageSize, String key,
|
| | | String type, Integer state, Integer sort, PrintWriter out) {
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "delete")
|
| | | public void delete(String callback, String idArray, PrintWriter out) {
|
| | | public void delete(AdminAcceptData acceptData,String callback, String idArray, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | if (StringUtil.isNullOrEmpty(idArray)) {
|