This commit is contained in:
@@ -8,7 +8,7 @@ public class HelloBean implements FilterBean {
|
||||
|
||||
private int helloid;
|
||||
|
||||
@RestHeader("hello-res")
|
||||
@RestHeader(name = "hello-res")
|
||||
private String res;
|
||||
|
||||
public int getHelloid() {
|
||||
|
||||
@@ -19,9 +19,9 @@ public class HelloEntity {
|
||||
|
||||
private long createtime;
|
||||
|
||||
@RestHeader("hello-res")
|
||||
@RestHeader(name = "hello-res")
|
||||
private String resname;
|
||||
|
||||
|
||||
@RestAddress
|
||||
private String clientaddr;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class HelloService implements Service {
|
||||
|
||||
//修改记录
|
||||
@RestMapping(name = "partupdate")
|
||||
public void updateHello(HelloEntity entity, @RestParam("cols") String[] columns) { //通过 /hello/partupdate?bean={...} 修改对象
|
||||
public void updateHello(HelloEntity entity, @RestParam(name = "cols") String[] columns) { //通过 /hello/partupdate?bean={...} 修改对象
|
||||
entity.setUpdatetime(System.currentTimeMillis());
|
||||
source.updateColumns(entity, columns);
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class HelloService implements Service {
|
||||
//查询单个
|
||||
@RestMapping(name = "find")
|
||||
@RestMapping(name = "jsfind", jsvar = "varhello")
|
||||
public HelloEntity findHello(@RestParam("#") int id) { //通过 /hello/find/1234 查询对象
|
||||
public HelloEntity findHello(@RestParam(name = "#") int id) { //通过 /hello/find/1234 查询对象
|
||||
return source.find(HelloEntity.class, id);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.redkale.util.Sheet;
|
||||
* HelloBean: Hellow模块实现FilterBean的过滤Bean类
|
||||
*
|
||||
*/
|
||||
@RestService(value = "hello", module = 0, repair = true, ignore = false)
|
||||
@RestService(name = "hello", moduleid = 0, repair = true, ignore = false)
|
||||
public class HelloService2 implements Service {
|
||||
|
||||
@Resource
|
||||
@@ -27,7 +27,7 @@ public class HelloService2 implements Service {
|
||||
|
||||
//增加记录
|
||||
@RestMapping(name = "create", auth = false)
|
||||
public RetResult<HelloEntity> createHello(UserInfo info, @RestParam("bean") HelloEntity entity) {
|
||||
public RetResult<HelloEntity> createHello(UserInfo info, @RestParam(name = "bean") HelloEntity entity) {
|
||||
entity.setCreator(info == null ? 0 : info.getUserid()); //设置当前用户ID
|
||||
entity.setCreatetime(System.currentTimeMillis());
|
||||
source.insert(entity);
|
||||
@@ -36,26 +36,26 @@ public class HelloService2 implements Service {
|
||||
|
||||
//删除记录
|
||||
@RestMapping(name = "delete", auth = false)
|
||||
public void deleteHello(@RestParam("#") int id) { //通过 /hello/delete/1234 删除对象
|
||||
public void deleteHello(@RestParam(name = "#") int id) { //通过 /hello/delete/1234 删除对象
|
||||
source.delete(HelloEntity.class, id);
|
||||
}
|
||||
|
||||
//修改记录
|
||||
@RestMapping(name = "update", auth = false)
|
||||
public void updateHello(@RestParam("bean") HelloEntity entity) { //通过 /hello/update?bean={...} 修改对象
|
||||
public void updateHello(@RestParam(name = "bean") HelloEntity entity) { //通过 /hello/update?bean={...} 修改对象
|
||||
entity.setUpdatetime(System.currentTimeMillis());
|
||||
source.update(entity);
|
||||
}
|
||||
|
||||
//查询列表
|
||||
@RestMapping(name = "query", auth = false)
|
||||
public Sheet<HelloEntity> queryHello(@RestParam("bean") HelloBean bean, Flipper flipper) { //通过 /hello/query/offset:0/limit:20?bean={...} 查询列表
|
||||
public Sheet<HelloEntity> queryHello(@RestParam(name = "bean") HelloBean bean, Flipper flipper) { //通过 /hello/query/offset:0/limit:20?bean={...} 查询列表
|
||||
return source.querySheet(HelloEntity.class, flipper, bean);
|
||||
}
|
||||
|
||||
//查询单个
|
||||
@RestMapping(name = "find", auth = false)
|
||||
public HelloEntity findHello(@RestParam("#") int id) { //通过 /hello/find/1234 查询对象
|
||||
public HelloEntity findHello(@RestParam(name = "#") int id) { //通过 /hello/find/1234 查询对象
|
||||
return source.find(HelloEntity.class, id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user