001package cn.mybatis.mp.generator.config; 002 003import cn.mybatis.mp.core.mvc.impl.ServiceImpl; 004import lombok.Getter; 005 006@Getter 007public class ServiceImplConfig { 008 009 /** 010 * 接口父类 011 */ 012 private String superClass = ServiceImpl.class.getName(); 013 014 /** 015 * 注入dao 016 */ 017 private boolean injectDao = true; 018 019 /** 020 * 注入Mapper 021 */ 022 private boolean injectMapper = false; 023 024 /** 025 * service实现类包名 026 */ 027 private String packageName = "service.impl"; 028 029 /** 030 * service实现后缀 031 */ 032 private String suffix = "ServiceImpl"; 033 034 /** 035 * 接口父类 036 */ 037 public ServiceImplConfig superClass(String superClass) { 038 this.superClass = superClass; 039 return this; 040 } 041 042 /** 043 * 注入dao 044 */ 045 public ServiceImplConfig injectDao(boolean injectDao) { 046 this.injectDao = injectDao; 047 return this; 048 } 049 050 /** 051 * 注入Mapper 052 */ 053 public ServiceImplConfig injectMapper(boolean injectMapper) { 054 this.injectMapper = injectMapper; 055 return this; 056 } 057 058 /** 059 * service实现类包名 060 */ 061 public ServiceImplConfig packageName(String packageName) { 062 this.packageName = packageName; 063 return this; 064 } 065 066 /** 067 * service实现后缀 068 */ 069 public ServiceImplConfig suffix(String suffix) { 070 this.suffix = suffix; 071 return this; 072 } 073}