// Path: spring-boot-oauth-authorization-server/src/main/java/com/sdcuike/practice/domain/StudentWithBLOBs.java
// public class StudentWithBLOBs extends Student {
//     private String bio;
// 
//     private byte[] pic;
// 
//     public String getBio() {
//         return bio;
//     }
// 
//     public void setBio(String bio) {
//         this.bio = bio == null ? null : bio.trim();
//     }
// 
//     public byte[] getPic() {
//         return pic;
//     }
// 
//     public void setPic(byte[] pic) {
//         this.pic = pic;
//     }
// }
// 
// Path: spring-boot-oauth-authorization-server/src/main/java/com/sdcuike/practice/domain/dto/StudentDto.java
// @Data
// @NoArgsConstructor
// public class StudentDto {
//     
//     private Long studId;
//     
//     private String name;
//     
//     private String email;
//     
//     private String phone;
//     
//     private LocalDateTime dob;
//     
//     private List<AddressDto> addresses;
// }
// 
// Path: spring-boot-oauth-authorization-server/src/main/java/com/sdcuike/practice/domain/dto/StudentDtoMapper.java
// @Mapper(uses = {AddressDtoMapper.class})
// public interface StudentDtoMapper {
//     
//     StudentDto student2Dto(StudentWithBLOBs studentWithBLOBs);
// }
// 
// Path: spring-boot-oauth-authorization-server/src/main/java/com/sdcuike/practice/mapper/StudentMapper.java
// @UseDataSourceTest
// public interface StudentMapper {
//     int deleteByPrimaryKey(Long studId);
// 
//     int insert(StudentWithBLOBs record);
// 
//     int insertSelective(StudentWithBLOBs record);
// 
//     StudentWithBLOBs selectByPrimaryKey(Long studId);
// 
//     int updateByPrimaryKeySelective(StudentWithBLOBs record);
// 
//     int updateByPrimaryKeyWithBLOBs(StudentWithBLOBs record);
// 
//     int updateByPrimaryKey(Student record);
// }


import com.doctor.beaver.domain.result.ModelResult;
import com.sdcuike.practice.domain.StudentWithBLOBs;
import com.sdcuike.practice.domain.dto.StudentDto;
import com.sdcuike.practice.domain.dto.StudentDtoMapper;
import com.sdcuike.practice.mapper.StudentMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
package com.sdcuike.practice.controller;


/**
 * Created by beaver on 2017/5/2.
 */
@RestController
@RequestMapping(path = "/student", produces = MediaType.APPLICATION_JSON_VALUE)
@Slf4j
public class StudentController {
    
    @Autowired
    private StudentMapper studentMapper;
    @Autowired
    private StudentDtoMapper studentDtoMapper;
    
    @GetMapping("/{id}")
    public ModelResult<StudentDto> queryById(@PathVariable("id") Long id) {
// Path: spring-boot-oauth-authorization-server/src/main/java/com/sdcuike/practice/domain/StudentWithBLOBs.java
// public class StudentWithBLOBs extends Student {
//     private String bio;
// 
//     private byte[] pic;
// 
//     public String getBio() {
//         return bio;
//     }
// 
//     public void setBio(String bio) {
//         this.bio = bio == null ? null : bio.trim();
//     }
// 
//     public byte[] getPic() {
//         return pic;
//     }
// 
//     public void setPic(byte[] pic) {
//         this.pic = pic;
//     }
// }
// 
// Path: spring-boot-oauth-authorization-server/src/main/java/com/sdcuike/practice/domain/dto/StudentDto.java
// @Data
// @NoArgsConstructor
// public class StudentDto {
//     
//     private Long studId;
//     
//     private String name;
//     
//     private String email;
//     
//     private String phone;
//     
//     private LocalDateTime dob;
//     
//     private List<AddressDto> addresses;
// }
// 
// Path: spring-boot-oauth-authorization-server/src/main/java/com/sdcuike/practice/domain/dto/StudentDtoMapper.java
// @Mapper(uses = {AddressDtoMapper.class})
// public interface StudentDtoMapper {
//     
//     StudentDto student2Dto(StudentWithBLOBs studentWithBLOBs);
// }
// 
// Path: spring-boot-oauth-authorization-server/src/main/java/com/sdcuike/practice/mapper/StudentMapper.java
// @UseDataSourceTest
// public interface StudentMapper {
//     int deleteByPrimaryKey(Long studId);
// 
//     int insert(StudentWithBLOBs record);
// 
//     int insertSelective(StudentWithBLOBs record);
// 
//     StudentWithBLOBs selectByPrimaryKey(Long studId);
// 
//     int updateByPrimaryKeySelective(StudentWithBLOBs record);
// 
//     int updateByPrimaryKeyWithBLOBs(StudentWithBLOBs record);
// 
//     int updateByPrimaryKey(Student record);
// }


// Path: spring-boot-oauth-authorization-server/src/main/java/com/sdcuike/practice/controller/StudentController.java
import com.doctor.beaver.domain.result.ModelResult;
import com.sdcuike.practice.domain.StudentWithBLOBs;
import com.sdcuike.practice.domain.dto.StudentDto;
import com.sdcuike.practice.domain.dto.StudentDtoMapper;
import com.sdcuike.practice.mapper.StudentMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

package com.sdcuike.practice.controller;


/**
 * Created by beaver on 2017/5/2.
 */
@RestController
@RequestMapping(path = "/student", produces = MediaType.APPLICATION_JSON_VALUE)
@Slf4j
public class StudentController {
    
    @Autowired
    private StudentMapper studentMapper;
    @Autowired
    private StudentDtoMapper studentDtoMapper;
    
    @GetMapping("/{id}")
    public ModelResult<StudentDto> queryById(@PathVariable("id") Long id) {
        ModelResult<StudentDto> result = new ModelResult<>();