-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
729 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package org.huifer.rbac.controller; | ||
|
||
import org.huifer.rbac.entity.req.IdsReq; | ||
import org.huifer.rbac.entity.req.PageReq; | ||
import org.huifer.rbac.entity.req.role.RoleAddReq; | ||
import org.huifer.rbac.entity.req.role.RoleEditorReq; | ||
import org.huifer.rbac.entity.req.role.RoleQueryReq; | ||
import org.huifer.rbac.entity.res.Result; | ||
import org.huifer.rbac.service.IRoleService; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/role") | ||
public class RoleController { | ||
@Autowired | ||
private IRoleService roleService; | ||
|
||
@PostMapping("/add") | ||
public Result add( | ||
@RequestBody @Validated RoleAddReq req | ||
) { | ||
return roleService.add(req); | ||
} | ||
|
||
@PostMapping("/query") | ||
public Result query( | ||
@RequestBody @Validated RoleQueryReq req, | ||
@RequestBody @Validated PageReq pageReq | ||
) { | ||
|
||
return roleService.query(req, pageReq); | ||
} | ||
|
||
@PostMapping("/editor") | ||
public Result editor(@RequestBody @Validated RoleEditorReq req) { | ||
return roleService.editor(req); | ||
} | ||
|
||
@PostMapping("/delete") | ||
public Result delete(@RequestBody @Validated IdsReq idsReq) { | ||
return roleService.delete(idsReq); | ||
} | ||
|
||
@PostMapping("/setting_btn") | ||
public Result settingBtn() { | ||
return null; | ||
} | ||
|
||
@PostMapping("/setting_menu") | ||
public Result settingMenu() { | ||
return null; | ||
} | ||
|
||
@PostMapping("/setting_url") | ||
public Result settingUrl() { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* Copyright 2009-2019 the original author or authors. | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.ibatis.type; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.Date; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.mockito.Mockito.*; | ||
|
||
class SqlTimeTypeHandlerTest extends BaseTypeHandlerTest { | ||
|
||
private static final TypeHandler<java.sql.Time> TYPE_HANDLER = new SqlTimeTypeHandler(); | ||
private static final java.sql.Time SQL_TIME = new java.sql.Time(new Date().getTime()); | ||
|
||
@Override | ||
@Test | ||
public void shouldSetParameter() throws Exception { | ||
TYPE_HANDLER.setParameter(ps, 1, SQL_TIME, null); | ||
verify(ps).setTime(1, SQL_TIME); | ||
} | ||
|
||
@Override | ||
@Test | ||
public void shouldGetResultFromResultSetByName() throws Exception { | ||
when(rs.getTime("column")).thenReturn(SQL_TIME); | ||
assertEquals(SQL_TIME, TYPE_HANDLER.getResult(rs, "column")); | ||
verify(rs, never()).wasNull(); | ||
} | ||
|
||
@Override | ||
public void shouldGetResultNullFromResultSetByName() throws Exception { | ||
// Unnecessary | ||
} | ||
|
||
@Override | ||
@Test | ||
public void shouldGetResultFromResultSetByPosition() throws Exception { | ||
when(rs.getTime(1)).thenReturn(SQL_TIME); | ||
assertEquals(SQL_TIME, TYPE_HANDLER.getResult(rs, 1)); | ||
verify(rs, never()).wasNull(); | ||
} | ||
|
||
@Override | ||
public void shouldGetResultNullFromResultSetByPosition() throws Exception { | ||
// Unnecessary | ||
} | ||
|
||
@Override | ||
@Test | ||
public void shouldGetResultFromCallableStatement() throws Exception { | ||
when(cs.getTime(1)).thenReturn(SQL_TIME); | ||
assertEquals(SQL_TIME, TYPE_HANDLER.getResult(cs, 1)); | ||
verify(cs, never()).wasNull(); | ||
} | ||
|
||
@Override | ||
public void shouldGetResultNullFromCallableStatement() throws Exception { | ||
// Unnecessary | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.huifer.cloud.config; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.config.server.EnableConfigServer; | ||
|
||
/** | ||
* <p>Title : ConfigServer </p> | ||
* <p>Description : </p> | ||
* | ||
* @author huifer | ||
* @date 2019-05-28 | ||
*/ | ||
@SpringBootApplication | ||
@EnableConfigServer | ||
public class ConfigServer { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(ConfigServer.class, args); | ||
} | ||
|
||
} |
Oops, something went wrong.