Skip to content

Commit

Permalink
write a line into test.file
Browse files Browse the repository at this point in the history
  • Loading branch information
huifer committed Jan 15, 2025
1 parent c1ad5a0 commit c25c693
Show file tree
Hide file tree
Showing 12 changed files with 729 additions and 0 deletions.
63 changes: 63 additions & 0 deletions docs/spring/cs18156d24-d2e1-11ef-af0c-acde48001122.java
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;
}
}
76 changes: 76 additions & 0 deletions docs/spring/cs185d96a8-d2e1-11ef-af0c-acde48001122.java
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
}

}
22 changes: 22 additions & 0 deletions docs/spring/cs1897c60c-d2e1-11ef-af0c-acde48001122.java
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);
}

}
Loading

0 comments on commit c25c693

Please sign in to comment.