SpringBoot学习总结(注意点)

2018-10-24  本文已影响0人  风丶无痕
@Configuration
public class BasicConfig {
    @Value("${c.snowflake.regin}")
    private long regin;

    @Value("${c.snowflake.node}")
    private long node;

    @Bean
    public Snowflake snowflake() {
        return new Snowflake(regin, node);
    }
}

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-test</artifactId>
</dependency>

然后打上如下的注解:

@RunWith(SpringRunner.class)
@SpringBootTest
public class AppControllerTest {

    @Test
    public void listAllTest(){
    
    }
}
@Query("select sc from Scene sc where sc.id=:sceneId and sc.appId=:appId")
List<Scene> findSceneBySceneIdAndAppId(@Param("sceneId") String sceneId, @Param("appId") String appId);
上一篇下一篇

猜你喜欢

热点阅读