Mars-cloud released version 2.1.6

Mars-cloud released 2.1.6 version

1. This version directly jumped to 1.0 from 2.1.6 to make the version number of the Mars-java consistent
2. New Feign function, call micro-Mars-cloud service interface later, you can Feign to analog
    quasi RPC calls

Mars-java version 2.1.6 release

1. start stripped out from the project, forming a separate item, to maintain separate
2. start using a chain of responsibility pattern to assemble the resources needed to start, change a more flexible
3. In addition to the file download function

Why remove the file download function?

Because the files on the download server, directly through http request to download the file itself so directly, you do not need to write client service to and from Mars.
Mars download service can return path of the file, you can directly download the client to get

this release, in addition to the new features Feign other aspects from the user's point of view, basically no change in function, appearance are no significant changes , just simply want to update a version, headstrong, next door because Apple is so dry.

Feign use

  1. Build a common java class
  2. In the above category plus MarsFeign annotations, see the following specific examples:
import com.mars.cloud.core.annotations.MarsFeign;
import com.test.entity.DemoEntity;

/* 这个注解的serverName跟你要调用的那个服务的name一致(yml文件里cloud配置的name) */
@MarsFeign(serverName="mars-demo")
public interface DemoFeign {
    /* 
        这里面的所有方法,跟你要调用的那个Controller的MarsMapping的value一致 
        方法的参数只能传一个或者不传,且参数必须是可序列化的
        方法的返回类型跟你的接口返回的数据一致
        方法的参数类型跟你的接口接参类型一致
    */
    String insert(DemoEntity entity);

    String selectList(DemoEntity entity);
}

This object is injected in your MarsBean or Controller Lane

@MarsBean("testService")
public class TestService {

    @Resource("demoFeign")
    private DemoFeign demoFeign;
}

Then you can directly call inside the method

Guess you like

Origin www.oschina.net/news/109832/mars-java-2-1-6-released