Commit b941670f by 杨林龙

完成Dubbo基本开发 yangll

1 parent c44ee63e
...@@ -58,7 +58,7 @@ public class PlatformCustomer implements Serializable { ...@@ -58,7 +58,7 @@ public class PlatformCustomer implements Serializable {
/** /**
* 城市 sys_area的id * 城市 sys_area的id
*/ */
private Integer Area; private Integer area;
/** /**
* 详细地址 * 详细地址
...@@ -255,11 +255,11 @@ public class PlatformCustomer implements Serializable { ...@@ -255,11 +255,11 @@ public class PlatformCustomer implements Serializable {
} }
public Integer getArea() { public Integer getArea() {
return Area; return area;
} }
public void setArea(Integer area) { public void setArea(Integer area) {
Area = area; this.area = area;
} }
@Override @Override
...@@ -273,7 +273,7 @@ public class PlatformCustomer implements Serializable { ...@@ -273,7 +273,7 @@ public class PlatformCustomer implements Serializable {
", contactEmail='" + contactEmail + '\'' + ", contactEmail='" + contactEmail + '\'' +
", province=" + province + ", province=" + province +
", city=" + city + ", city=" + city +
", Area=" + Area + ", Area=" + area +
", address='" + address + '\'' + ", address='" + address + '\'' +
", status=" + status + ", status=" + status +
", publicKey='" + publicKey + '\'' + ", publicKey='" + publicKey + '\'' +
......
...@@ -26,4 +26,6 @@ public interface PlatformCustomerMapper extends OreMapper<PlatformCustomer> { ...@@ -26,4 +26,6 @@ public interface PlatformCustomerMapper extends OreMapper<PlatformCustomer> {
int login(PlatformCustomer customer); int login(PlatformCustomer customer);
List<String> getAddressOptionList(@Param("id") int id); List<String> getAddressOptionList(@Param("id") int id);
String getAddressStr(@Param("province") Integer province);
} }
\ No newline at end of file \ No newline at end of file
...@@ -10,9 +10,7 @@ import com.alibaba.dubbo.config.annotation.Service; ...@@ -10,9 +10,7 @@ import com.alibaba.dubbo.config.annotation.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.security.PrivateKey; import java.security.PrivateKey;
import java.security.PublicKey; import java.security.PublicKey;
import java.security.SecureRandom;
import java.util.List; import java.util.List;
import java.util.Random;
import java.util.UUID; import java.util.UUID;
@Service @Service
...@@ -60,6 +58,11 @@ public class CustomerMgrServiceImpl implements CustomerMgrService { ...@@ -60,6 +58,11 @@ public class CustomerMgrServiceImpl implements CustomerMgrService {
PublicKey publicKey = RsaUtil.generatePublicKey(modulus, exponent); PublicKey publicKey = RsaUtil.generatePublicKey(modulus, exponent);
customer.setPrivateKey(privateKey.getAlgorithm()); customer.setPrivateKey(privateKey.getAlgorithm());
customer.setPublicKey(publicKey.getAlgorithm()); customer.setPublicKey(publicKey.getAlgorithm());
String province = customerMapper.getAddressStr(customer.getProvince());
String city = customerMapper.getAddressStr(customer.getCity());
String area = customerMapper.getAddressStr(customer.getArea());
customer.setAddress(province + city + area + customer.getAddress());
return customerMapper.insertSelective(customer); return customerMapper.insertSelective(customer);
} }
......
...@@ -69,4 +69,11 @@ ...@@ -69,4 +69,11 @@
</choose> </choose>
</select> </select>
<select id="getAddressStr" resultType="java.lang.String">
select
area_name
from t_sys_area
where id = #{id,jdbcType=INTEGER}
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!