Commit 84848d16 authored by taabe's avatar taabe

添加测试表tb_demo

parent 10e625f6
...@@ -36,7 +36,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; ...@@ -36,7 +36,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
"org.typroject.tyboot.face.*.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.core.auth.face.orm.dao*",
"org.typroject.tyboot.component.*.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"org.amos.boot.module.tzs.biz.dao.mapper"}) "org.amos.boot.module.jcs.api.mapper"})
@ComponentScan(basePackages = { "org.amos.boot", "org.typroject", "com.yeejoin.amos" }) @ComponentScan(basePackages = { "org.amos.boot", "org.typroject", "com.yeejoin.amos" })
public class AmosJcsApplication public class AmosJcsApplication
{ {
...@@ -46,12 +46,13 @@ public class AmosJcsApplication ...@@ -46,12 +46,13 @@ public class AmosJcsApplication
{ {
ConfigurableApplicationContext context = SpringApplication.run(AmosJcsApplication.class, args); ConfigurableApplicationContext context = SpringApplication.run(AmosJcsApplication.class, args);
Environment environment = context.getEnvironment(); Environment environment = context.getEnvironment();
logger.info("The requested service of " + environment.getProperty("spring.application.name") logger.info("The requested service of " + environment.getProperty("spring.application.name")
+ " has already been started in " + " has already been started in "
+ environment.getProperty("spring.profiles.active") + "" + environment.getProperty("spring.profiles.active") + ""
+ " environment,and service's url is 'http://localhost:" + " environment,and service's url is 'http://localhost:"
+ environment.getProperty("server.port") + "/swagger-ui.html'"); + environment.getProperty("server.port")
+ environment.getProperty("server.servlet.context-path") + "/swagger-ui.html'");
} }
} }
#DB properties:
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://172.16.10\
.66:3306/amos_demo?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=root_123
#eureka properties:
eureka.instance.hostname=172.16.10.72
eureka.instance.prefer-ip-address=true
eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:10001/eureka/
spring.application.name=AIRPORT
server.servlet.context-path=/airPort
server.port=11000
spring.profiles.active=dev
\ No newline at end of file
package org.amos.boot.module.jcs.api.entity; package org.amos.boot.module.jcs.api.entity;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import java.util.Date;
/**
* @author DELL
*/
@Data @Data
@EqualsAndHashCode(callSuper=false) @EqualsAndHashCode(callSuper=false)
@TableName("cb_demo") @TableName("tb_demo")
@ApiModel(value = "cb_firewarden对象", description = "Demo示例") @ApiModel(value = "tb_demo对象", description = "Demo示例")
public class CbDemo extends BaseEntity{ public class CbDemo extends BaseEntity {
/**
*
*/
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "真实名称")
private Long real_name; @ApiModelProperty(value = "NAME")
private String name;
} }
package org.amos.boot.module.jcs.biz.controller; package org.amos.boot.module.jcs.biz.controller;
import java.util.List; import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.amos.boot.biz.common.controller.BaseController; import org.amos.boot.biz.common.controller.BaseController;
import org.amos.boot.biz.common.utils.CommonResponseUtil; import org.amos.boot.biz.common.utils.CommonResponseUtil;
import org.amos.boot.module.jcs.api.entity.CbDemo; import org.amos.boot.module.jcs.api.entity.CbDemo;
...@@ -10,10 +10,11 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -10,10 +10,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import io.swagger.annotations.Api; import java.util.List;
import lombok.extern.slf4j.Slf4j;
/** /**
* 示例控制类 * 示例控制类
...@@ -24,15 +25,15 @@ import lombok.extern.slf4j.Slf4j; ...@@ -24,15 +25,15 @@ import lombok.extern.slf4j.Slf4j;
@RequestMapping("/demo") @RequestMapping("/demo")
@Api(tags="示例") @Api(tags="示例")
@Slf4j @Slf4j
public class DemoController extends BaseController{ public class DemoController extends BaseController {
@Autowired @Autowired
private IDemoService demoService; private IDemoService demoService;
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/user") @GetMapping(value = "/user")
public ResponseModel<Object> findUserList(){ public ResponseModel<Object> findUserList() {
List<CbDemo> lists = demoService.list(); List<CbDemo> lists = demoService.list();
return CommonResponseUtil.success(lists); return CommonResponseUtil.success(lists);
} }
} }
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