Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenlj authored Aug 15, 2024
2 parents 2ccf23c + c600334 commit 164d588
Show file tree
Hide file tree
Showing 228 changed files with 6,768 additions and 6,836 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<alibaba-spring-context-support.version>1.0.11</alibaba-spring-context-support.version>
</properties>

<dependencies>
Expand All @@ -44,6 +45,7 @@
<dependency>
<groupId>com.alibaba.spring</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring-context-support.verison}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<alibaba-spring-context-support.version>1.0.11</alibaba-spring-context-support.version>
</properties>

<dependencies>
Expand All @@ -44,6 +45,7 @@
<dependency>
<groupId>com.alibaba.spring</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring-context-support.verison}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.12.5</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
$xtxColor: #27ba9b;
$helpColor: #e26237;
$sucColor: #1dc779;
$warnColor: #ffb302;
$priceColor: #cf4444;
package org.apache.dubbo.rest.demo.pojo;

public enum Color {
RED,
GREEN,
BLUE
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,27 @@
package org.apache.dubbo.rest.demo.routine;


import org.apache.dubbo.rest.demo.pojo.Color;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.Date;
import java.util.Optional;
@Path("/")
public interface BasicParamRequestService {
@GET
@Path("/primitive")
@Path("/primitiveInt")
int primitiveInt(@QueryParam("a") int a, @QueryParam("b") int b);

@GET
Expand All @@ -37,13 +49,115 @@ public interface BasicParamRequestService {
@Path("/primitiveByte")
byte primitiveByte(@QueryParam("a") byte a, @QueryParam("b") byte b);


@GET
@Path("/primitiveDouble")
double primitiveDouble(@QueryParam("a") double a,@QueryParam("b") double b);

@GET
@Path("/primitiveString")
@Path("/primitiveShort")
short primitiveShort(@QueryParam("a") short a, @QueryParam("b") short b);

@GET
@Path("/primitiveChar")
char primitiveChar(@QueryParam("a") char a, @QueryParam("b") char b);

@GET
@Path("/primitiveBoolean")
boolean primitiveBoolean(@QueryParam("a") boolean a, @QueryParam("b") boolean b);

@GET
@Path("/primitiveFloat")
double primitiveFloat(@QueryParam("a") float a, @QueryParam("b") float b);


@GET
@Path("/wrapperInt")
Integer wrapperInt(@QueryParam("a") Integer a, @QueryParam("b") Integer b);

@GET
@Path("/wrapperLong")
Long wrapperLong(@QueryParam("a") Long a, @QueryParam("b") Long b);

@GET
@Path("/wrapperByte")
Byte wrapperByte(@QueryParam("a") Byte a, @QueryParam("b") Byte b);

@GET
@Path("/wrapperDouble")
Double wrapperDouble(@QueryParam("a") Double a,@QueryParam("b") Double b);

@GET
@Path("/wrapperShort")
Short wrapperShort(@QueryParam("a") Short a, @QueryParam("b") Short b);

@GET
@Path("/wrapperCharacter")
Character wrapperChar(@QueryParam("a") Character a, @QueryParam("b") Character b);

@GET
@Path("/wrapperBoolean")
Boolean wrapperBoolean(@QueryParam("a") Boolean a, @QueryParam("b") Boolean b);


@GET
@Path("/intArray")
int[] intArray(@QueryParam("array") int[] aray);

@GET
@Path("/longArray")
long[] longArray(@QueryParam("array") long[] aray);

@GET
@Path("/bigInt")
BigInteger bigInt(@QueryParam("a") BigInteger a, @QueryParam("b") BigInteger b);

@GET
@Path("/bigDecimal")
BigDecimal bigDecimal(@QueryParam("a") BigDecimal a, @QueryParam("b") BigDecimal b);

@GET
@Path("/date")
Date date(@QueryParam("date") Date date);

@GET
@Path("/calendar")
Calendar date(@QueryParam("calendar") Calendar calendar);

@GET
@Path("/Instant")
Instant date(@QueryParam("instant") Instant instant);


@GET
@Path("/localDate")
LocalDate date(@QueryParam("localDate") LocalDate localDate);

@GET
@Path("/localTime")
LocalTime date(@QueryParam("localTime") LocalTime localTime);

@GET
@Path("/localDateTime")
LocalDateTime date(@QueryParam("localDateTime") LocalDateTime localDateTime);

@GET
@Path("/zonedDateTime")
ZonedDateTime date(@QueryParam("zonedDateTime") ZonedDateTime zonedDateTime);

@GET
@Path("/optionalString")
@Produces(MediaType.TEXT_PLAIN)
String primitiveString(@QueryParam("a") String a,@QueryParam("b") String b);
Optional<String> optionalString(@QueryParam("optionalString") Optional<String> optional);

@GET
@Path("/optionalInt")
Optional<Integer> optionalInteger(@QueryParam("optionalInt") Optional<Integer> optional);

@GET
@Path("/optionalDouble")
Optional<Double> optionalDouble(@QueryParam("optionalDouble") Optional<Double> optional);

@GET
@Path("/enum")
Color testEnum(@QueryParam("enum") Color color);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
package org.apache.dubbo.rest.demo.routine;

import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rest.demo.pojo.Color;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.Date;
import java.util.Optional;

@DubboService
public class BasicParamRequestServiceImpl implements BasicParamRequestService{
Expand All @@ -44,8 +56,136 @@ public double primitiveDouble(double a, double b) {
}

@Override
public String primitiveString(String a, String b) {
public short primitiveShort(short a, short b) {
return (short) (a+b);
}

@Override
public char primitiveChar(char a, char b) {
return (char)(a + b);
}

@Override
public boolean primitiveBoolean(boolean a, boolean b) {
return a & b;
}

@Override
public double primitiveFloat(float a, float b) {
return a + b;
}

@Override
public Integer wrapperInt(Integer a, Integer b) {
return a + b;
}

@Override
public Long wrapperLong(Long a, Long b) {
return a + b;
}

@Override
public Byte wrapperByte(Byte a, Byte b) {
return (byte) (a + b);
}

@Override
public Double wrapperDouble(Double a, Double b) {
return a + b;
}

@Override
public Short wrapperShort(Short a, Short b) {
return (short)(a + b);
}

@Override
public Character wrapperChar(Character a, Character b) {
return (char)(a+b);
}

@Override
public Boolean wrapperBoolean(Boolean a, Boolean b) {
return a & b;
}


@Override
public int[] intArray(int[] aray) {
return aray;
}

@Override
public long[] longArray(long[] aray) {
return aray;
}

@Override
public BigInteger bigInt(BigInteger a, BigInteger b) {
return a.add(b);
}

@Override
public BigDecimal bigDecimal(BigDecimal a, BigDecimal b) {
return a.add(b);
}

@Override
public Date date(Date date) {
return date;
}

@Override
public Calendar date(Calendar calendar) {
return calendar;
}

@Override
public Instant date(Instant instant) {
return instant;
}

@Override
public LocalDate date(LocalDate localDate) {
return localDate;
}

@Override
public LocalTime date(LocalTime localTime) {
return localTime;
}

@Override
public LocalDateTime date(LocalDateTime localDateTime) {
return localDateTime;
}

@Override
public ZonedDateTime date(ZonedDateTime zonedDateTime) {
System.out.println(zonedDateTime);
return zonedDateTime;
}

@Override
public Optional<String> optionalString(Optional<String> optional) {
return optional;
}

@Override
public Optional<Integer> optionalInteger(Optional<Integer> optional) {
return optional;
}

@Override
public Optional<Double> optionalDouble(Optional<Double> optional) {
return optional;
}

@Override
public Color testEnum(Color color) {
return color;
}


}
Loading

0 comments on commit 164d588

Please sign in to comment.