Commit cd7a0aef authored by Quxl's avatar Quxl

评委组

parent f0d2c6a6
package com.egolm.film.api.admin; package com.egolm.film.api.admin;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.admin.service.AdminTokenService; import com.egolm.film.api.admin.service.AdminTokenService;
import com.egolm.film.api.admin.service.AdminUserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@Api @Api
@Controller @Controller
...@@ -17,9 +26,24 @@ public class AdminUserController { ...@@ -17,9 +26,24 @@ public class AdminUserController {
@Autowired @Autowired
AdminTokenService tokenService; AdminTokenService tokenService;
public Rjx queryGroupList(String keyword, Long index, Long limit) { @Autowired
AdminUserService service;
return Rjx.jsonOk();
@ResponseBody
@RequestMapping("groupList")
@ApiOperation("评委组分页查询")
@ApiImplicitParams({
@ApiImplicitParam(paramType="query", dataType="string", required=false, name="keyword", value="关键字"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="index", value="分页编号"),
@ApiImplicitParam(paramType="query", dataType="long", required=true, name="limit", value="分页大小"),
})
public Rjx queryGroupList(String keyword, Long index, Long limit) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit);
List<Map<String, Object>> list = service.queryGroupList(keyword, page);
return Rjx.jsonOk().setData(list);
} }
......
package com.egolm.film.api.admin.service; package com.egolm.film.api.admin.service;
import java.util.List;
import java.util.Map;
import com.egolm.common.jdbc.Page;
public interface AdminUserService { public interface AdminUserService {
List<Map<String, Object>> queryGroupList(String keyword, Page page);
} }
package com.egolm.film.api.admin.service.impl; package com.egolm.film.api.admin.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.admin.service.AdminUserService; import com.egolm.film.api.admin.service.AdminUserService;
import com.egolm.film.util.SqlWhere;
@Service @Service
public class AdminUserServiceImpl implements AdminUserService { public class AdminUserServiceImpl implements AdminUserService {
@Autowired
JdbcTemplate jdbcTemplate;
@Override
public List<Map<String, Object>> queryGroupList(String keyword, Page page) {
SqlWhere argEdit = new SqlWhere().like("group_name", keyword);
String sql = "select * from fc_user_group" + StringUtil.join(" and ", " where ", "", "", argEdit.getArgs());
return jdbcTemplate.limit(sql, page, argEdit.getObjs());
}
} }
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